I have a string that contains some text followed by a blank line. What\'s the best way to keep the part with text, but remove the whitespace newline from the end?
Another elegant solution.
String myString = "\nLogbasex\n"; myString = org.apache.commons.lang3.StringUtils.strip(myString, "\n");