What method would you suggest to normalizing a text in Java, for example
String raw = " This is\n a test\n\r ";
String txt = normalize(raw);
assert txt == "This is a test";
I’m thinking about StringUtils .replace() and .strip() methods, but maybe there is some easier way.
Try the following if it is just a matter of whitespaces