转载请注明:http://www.pmjava.com/?thread-62961-1.html |
-
- package com.test;
-
- public class StringTest {
- public static void main(String... args) {
- String str = "!!!??!!!!%*)%¥!KTV去符号标号!!当然。!!..**半角";
-
-
- System.out.println(str.replaceAll("\\pP", ""));
- System.out.println(str.replaceAll("\\p{P}", ""));
- }
-
- }
|