stringformatter
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revision | |||
| stringformatter [2022/05/23 16:40] – frchris | stringformatter [2022/05/23 16:42] (current) – frchris | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| **StringFormatter** | **StringFormatter** | ||
| [[https:// | [[https:// | ||
| - | < | + | < |
| import java.util.ArrayList; | import java.util.ArrayList; | ||
| import java.util.List; | import java.util.List; | ||
| Line 36: | Line 36: | ||
| return spaces - gaps*gapWidth; | return spaces - gaps*gapWidth; | ||
| } | } | ||
| - | + | ||
| - | public static void main(String[] args) | + | |
| - | { | + | |
| - | String[] words1 = {" | + | |
| - | String[] words2 = {" | + | |
| - | String[] words3 = {" | + | |
| - | String[] words4 = {" | + | |
| - | testItWith(words1, | + | |
| - | testItWith(words2, | + | |
| - | testItWith(words3, | + | |
| - | testItWith(words4, | + | |
| - | } | + | |
| public static void testItWith(String[] words, int wordCount, int gaps, int leftOvers) | public static void testItWith(String[] words, int wordCount, int gaps, int leftOvers) | ||
| { | { | ||
| Line 68: | Line 57: | ||
| | | ||
| } | } | ||
| + | | ||
| + | | ||
| + | public static void main(String[] args) | ||
| + | { | ||
| + | String[] words1 = {" | ||
| + | String[] words2 = {" | ||
| + | String[] words3 = {" | ||
| + | String[] words4 = {" | ||
| + | testItWith(words1, | ||
| + | testItWith(words2, | ||
| + | testItWith(words3, | ||
| + | testItWith(words4, | ||
| + | } | ||
| } | } | ||
| + | |||
| + | |||
| </ | </ | ||
stringformatter.txt · Last modified: 2022/05/23 16:42 by frchris