课堂练习三

public static void main(String[] args) {

//  正则  将数字去除
String s=  "Once1a2woif,3always4a5woif!";
String regex="\\d+";//d代表任意数字  +代表多次
String s2=s.replaceAll(regex, " ");
System.out.println(s2);
}

猜你喜欢

转载自blog.csdn.net/qq_39539367/article/details/78215991