如何使用文本格式字符转换字符串?

时间:2015-05-20 11:46:49

标签: android

服务器向我返回一个包含文本格式字符的字符串,如“\ n”。我想知道是否存在我可以使用的默认方法。

这样的东西

convert(“first string \ nsecond string”) - >

第一个字符串

第二个字符串

它也属于“\”,服务器返回“\”;

知道我使用此代码:

string.replace("\\n", System.getProperty("line.separator")

但它看起来像是黑客。有什么建议吗?

0 个答案:

没有答案