String str=“asadasd1213只要汉字‘’;【】【】【!!!@@”
String express = str.replaceAll("[,。、_—— ^|~!@#¥;;:=<><><>:【》‘“”、】\"\"《\\??:.。,:{}%……&\\ A-Za-z0-9]","").trim();
string的replaceall方法用来去掉某些指定的字符,trim()去掉空格
String str=“asadasd1213只要汉字‘’;【】【】【!!!@@”
String express = str.replaceAll("[,。、_—— ^|~!@#¥;;:=<><><>:【》‘“”、】\"\"《\\??:.。,:{}%……&\\ A-Za-z0-9]","").trim();
string的replaceall方法用来去掉某些指定的字符,trim()去掉空格