Since you are assured the String end at the \n, always add a second print line to print a CR.
By the way, your program will soon run out of memory as you are creating many NEW Strings.
Since you are assured the String end at the \n, always add a second print line to print a CR.
By the way, your program will soon run out of memory as you are creating many NEW Strings.