diff --git a/src/TextOutput.java b/src/TextOutput.java index 30f9337..468bc31 100644 --- a/src/TextOutput.java +++ b/src/TextOutput.java @@ -33,43 +33,6 @@ public class TextOutput { } - private void toFormatold(ArrayList 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.