/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package util.str;
import java.util.StringTokenizer;
/**
*
* @author JJG
*/
public class SpecialCharactor {
private static String specialCharactor = "囧⊙●○⊕◎Θ⊙¤㈱㊣★☆♀◆◇◣◢◥▲▼△▽⊿◤ ◥ ▂ ▃ ▄ ▅ ▆ ▇ █ █ ■ ▓"";
public static void main(String[] args){
String[] str = new String[1];
str[0] ="'02400012','(报到','2000囧⊙-10-07 14:53:44','沈阳通 ▄ ▅ ▆ ▇ █ █监控消息'囧Θ你好●今天";
deleteCharactor(str);
}
public static String[] deleteCharactor(String strDelete ) {
String str = "";
try {
StringTokenizer st1 = new StringTokenizer(strDelete);
while (st1.hasMoreTokens()) {
// for(String ss : specCharactor) {
// str = str + st1.nextToken(ss);
// }
str = str + st1.nextToken(specialCharactor);
}
str = str.trim();
//System.out.println(str);//结果
} catch (Exception e) {
System.out.println(e);
}
return str;
}
}
注:
-
特殊字符可以