笨方法,不过我的程序都这么处理(举例,将"变为a)
package myclass;
public class DelSQ {
public static String convert(String str){
try {
if(str == null)
str = " ";
StringBuffer sb = new StringBuffer(str);
char[] ch = {'a'};
for(int i=0; i<=sb.length()-1; i++) {
sb.getChars(i, i+1, ch, 0);
if(ch[0] == '\"')
sb.replace(i, i+1, "a");
}
String te = new String(sb);
return te;
}
catch(Exception e) {
return str;
}
}
}