首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 移动开发 > 移动开发 >

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

2013-09-30 
去掉空格、回车、换行符、制表符??public static String replaceBlank(String str) {String a if (str!n

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

?

?

  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;    }
?

热点排行