去掉字符串中的英文
作者:互联网
利用正则表达式匹配字母,然后替换
public class Test {
public static void main(String[] args) {
String str = "asdasasdkdlsdaa668*)(^%*YTILKHqwe12345jfkhkab";
str = str.replaceAll("[a-zA-Z]","" );
System.out.println(str);
}
}
输出的结果:
668*)(^%*12345
标签:asdasasdkdlsdaa668,英文,668,System,str,字符串,去掉,public,String 来源: https://blog.csdn.net/qq_42981242/article/details/111996824