Is it possible to format the input from the serial monitor?

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.