简体   繁体   中英

String format issue due to new line start

I have a text String, in this form

Lorem ipsum dolor sit amet, 
consectetuer adipiscing elit
, 
lo 
sed diam 
nonummy nibh 
quis 
nostrud exerci.

So looks realy bad when I set the text in a textView.

I need that the String is loaded in this form

Lorem ipsum dolor sit amet, 
consectetuer adipiscing elit, 
lo sed diam nonummy nibh quis 
nostrud exerci.

Filling all the row (when is possible) before start new line.

Since cannot edit all the db entries to adjust the text.

使用此代码删除文本中的所有新行特殊字符

yourstring.replaceAll("[\n\r]", "")

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM