Replace new line/return with space using regex

前端 未结 7 1774
醉梦人生
醉梦人生 2020-12-24 06:36

Pretty basic question for someone who knows.

Instead of getting from

\"This is my text. 

And here is a ne         


        
7条回答
  •  天涯浪人
    2020-12-24 06:48

    This should take care of space, tab and newline:

    data = data.replaceAll("[ \t\n\r]*", " ");
    

提交回复
热议问题