除去字符串中的换行符合空格

newText=theText.replace(' ', ' ');//单引号里面至少需要一个空格,或者其他字符
newText = theText.replaceAll(" ", "");后面双引号可以不包括任何内容

注意原来的字符串不会改变

原文地址:https://www.cnblogs.com/weilen/p/8340284.html