正则替换字符串的全角、半角标点符号
感谢【火龙果】,钦佩他的研究精神。http://topic.csdn.net/u/20080925/15/41b814bf-fcaf-4b37-be91-10561a102768.html
测试代码如下:<span /><div class="highlighter">
[*]<span />class T {
[*] public static void main(String... args) {
[*] String str = "!!!!去符号标号!!当然。!!..**半角";
[*] System.out.println(str);
[*] System.out.println(str.replaceAll("\\p{Punct}", ""));
[*] System.out.println(str.replaceAll("\\pP", ""));
[*] }
[*]}
页:
[1]