Pretty basic question for someone who knows.
Instead of getting from
\"This is my text. And here is a ne
This should take care of space, tab and newline:
data = data.replaceAll("[ \t\n\r]*", " ");