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

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

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

posted @ 2018-01-24 10:17  微冷不觉寒  阅读(212)  评论(0编辑  收藏  举报