1. public class StringUtil {   
  2.     public static String getStringNoBlank(String str) {   
  3.         if(str!=null && !"".equals(str)) {   
  4.             Pattern p = Pattern.compile("\\s*|\t|\r|\n");   
  5.             Matcher m = p.matcher(str);   
  6.             String strNoBlank = m.replaceAll("");   
  7.             return strNoBlank;   
  8.         }else {   
  9.             return str;   
  10.         }        
  11.     }   

相关文章:

  • 2021-11-20
  • 2021-09-30
  • 2022-12-23
  • 2022-02-09
  • 2022-12-23
猜你喜欢
  • 2021-12-12
  • 2021-11-17
  • 2022-01-11
  • 2022-12-23
  • 2022-12-23
  • 2022-02-13
相关资源
相似解决方案