diff --git a/text-io/src/main/java/org/beryx/textio/TextTerminal.java b/text-io/src/main/java/org/beryx/textio/TextTerminal.java index b5e54a0f..d07576f2 100644 --- a/text-io/src/main/java/org/beryx/textio/TextTerminal.java +++ b/text-io/src/main/java/org/beryx/textio/TextTerminal.java @@ -177,6 +177,20 @@ default void println(String message) { println(); } + /** + * Prints a decorated line separator with a character of choice determined by the String parameter. + * the length parameter dictates how many characters the decorator should be. + * the decorator does not need to be a single character ie : '*' ... it could also be ie '+++' if desired. + */ + default void separateLineWithDecorator(String s, int length) { + String separator = ""; + for (int i = 0; i < length; i++){ + separator = separator + s; + } + print(separator); + println(); + } + /** * Prints each message in the list, inserting the line separator string between messages. * No separator string is printed after the last message.