读书人

去除空格、回车、换行符、制表符

发布时间: 2013-09-30 09:50:49 作者: rapoo

去掉空格、回车、换行符、制表符

?

?

  public static String replaceBlank(String str) {        String a= "";        if (str!=null) {            Pattern p = Pattern.compile("\\s*|\t|\r|\n");            Matcher m = p.matcher(str);            a= m.replaceAll("");        }        return a;    }
?

读书人网 >移动开发

热点推荐