Android examples for XML:XML String
remove Xml Bad Symbols
//package com.java2s; public class Main { public static void main(String[] argv) throws Exception { String str = "java2s.com"; System.out.println(removeXmlBadSymbols(str)); }//from www. j a v a 2 s .c o m private static final String ERROR_SYMBOLS = "[&\\?<>\"\'\\{}@]"; public static String removeXmlBadSymbols(String str) { if (str == null) { return ""; } return str.replaceAll(ERROR_SYMBOLS, " "); } }