deleted unused method

This commit is contained in:
Leonardo Brandenberger 2021-11-11 15:47:21 +01:00
parent 04647a5934
commit ac8aa5d193
1 changed files with 0 additions and 37 deletions

View File

@ -33,43 +33,6 @@ public class TextOutput {
}
private void toFormatold(ArrayList<String> text) {
for (String paragraph : text) {
String[] words = paragraph.split(" ");
int currentLength = 0;
for (String word : words) {
if (word.length() > columnWidth) {
String[] letters = word.split("");
int letterLenght = letters.length;
int lettersPrinted = 0;
do {
currentLength = 0;
for (int i = 0; i < columnWidth; i++) {
if (letterLenght > 0) {
System.out.print(letters[lettersPrinted]);
letterLenght--;
lettersPrinted++;
currentLength++;
}
}
if (!(letterLenght == 0)) {
System.out.println();
}
}
while (letterLenght >= columnWidth);
} else {
if (word.length() >= columnWidth - currentLength) {
currentLength = 0;
System.out.println();
}
System.out.print(word + " ");
currentLength += word.length() + 1;
}
}
System.out.println(); //added
}
}
/**
* Method to print out the paragraphs with the length taken from columnWidth and adding leftover words to the next
* paragraph.