正则替换字符串的全角、半角标点符号

  1. class  T {
  2.    public   static   void  main(String[] args) {
  3.     String str =  "!!!!去符号标号!!当然。!!..**半角" ;
  4.     System.out.println(str);
  5.     System.out.println(str.replaceAll( "\\p{Punct}" "" ));\\替换半角
  6.     System.out.println(str.replaceAll( "\\pP" "" ));\\替换所有
  7.   }
  8. }

 

你可能感兴趣的:(Java,数据库)