package test;
public class LuanMaTest {
public static void main(String[] args) {
System.out.println(new LuanMaTest().cclm("ab?c"));;
}
public boolean cclm(String source) {
boolean flag = true;
char ws[] = new char[] { '"', '?', ' ', '\'', '&' };
for (int i = 0; i < source.length(); i++) {
char c = source.charAt(i);
for (int j = 0; j < ws.length; j++) {
char v = ws[j];
if (c == v) {
flag = false;
}
}
if ((int) c == 0xfffd) {
flag = false;
}
}
return flag;
}
}
刚给你写的,已经经过测试,如果对你有用,记得采纳啊,一行一行打的代码,挺辛苦的,哈哈
那照你说的,什么才不时乱码呢???