如何从Android中的XML提要删除特殊字符? [英] How to remove special characters from the XML feed in android?
本文介绍了如何从Android中的XML提要删除特殊字符?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我从服务器接收XML提要有时也有在feedsa一些特殊characteres。如何删除特殊符号?
I'm receiving XML feed from a server and sometimes there are some special characteres in the feedsa. How can I remove special symbols?
我试图用的ArrayList
。它的工作,但我需要在字符串中使用它。我怎样才能做到这一点?
I'm trying with using ArrayList
. It's working but I need to use it in with String. How can I do this?
推荐答案
在我的code是上面一样,但不需要所有的if语句这样:
In my code it is as above but dont need all the if statements so:
public static String getXMLString(String content) {
content = content.replace("&", "&");
content = content.replace("<", "<");
content = content.replace(">", ">");
content = content.replace("'", "'");
content = content.replace("\"", """);
return content;
}
这篇关于如何从Android中的XML提要删除特殊字符?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文