java,php,asp.net,linux,javascript,mysql,mssql,oracle,编程

java去标点符号 正则

转载请注明:http://www.pmjava.com/?thread-62961-1.html
java代码 
  1.   
  2. package com.test;  
  3.   
  4. public class StringTest {  
  5.      public static void main(String... args) {     
  6.             String str = "!!!??!!!!%*)%¥!KTV去符号标号!!当然。!!..**半角";     
  7.            // System.out.println(str);     
  8.             System.out.println(str.replaceAll("\\p{Punct}", ""));     
  9.             System.out.println(str.replaceAll("\\pP"""));     
  10.             System.out.println(str.replaceAll("\\p{P}"""));     
  11.           }     
  12.   
  13. }  

posted on 2009-06-20 03:28 rrong_m 阅读(3464) 评论(0)  编辑  收藏

<2009年6月>
31123456
78910111213
14151617181920
21222324252627
2829301234
567891011

导航

统计

常用链接

随笔档案

文章分类

文章档案

java编程

搜索

积分与排名

最新评论

阅读排行榜

评论排行榜