android - \n appears in string is not funcional -
when getstring of database:
inf = c.getstring(5); //inf equals "hello how you?\nfine , you\ni fine, thanks.";
when print appears in same way , not execute parameters "\ n":
tv1.settext(inf); //the text "is hello how you?\nfine , you\ni fine, thanks."
but want:
"hello how you? fine , fine, thanks."
what problem?
the solution me:
string finalinf = inf.replace("\\n", system.getproperty("line.separator")); tv1.settext(finalinf);
thanks : skaard-solo , rest.
i think can try
string finalinf = inf.replace("\\n", system.getproperty("line.separator")); tv1.settext(finalinf); system.getproperty("line.separator"))
is system replacement new line
Comments
Post a Comment