当获取数据库的字符串时:
inf = c.getstring(5);
//inf is equals "Hello how are you?\nFine and you\nI am fine, thanks.";
当我打印时它以相同的方式出现并且不执行参数“\ n”:
tV1.setText(inf);
//the text "is Hello how are you?\nFine and you\nI am fine, thanks."
但我想要:
"Hello how are you?
Fine and you
I am fine, thanks."
问题是什么?
我的解决方案:
String finalInf = inf.replace("\\n", System.getProperty("line.separator"));
tV1.setText(finalInf);
谢谢:Skaard-Solo 和休息。