public static String replaceBlank(String str) {
String dest = "";
if (str!=null) {
Pattern p = Pattern.compile("\\s*|\t|\r|\n");
Matcher m = p.matcher(str);
dest = m.replaceAll("");
}
return dest;
}
Android 字符串处理之移除不可见字符
推荐阅读更多精彩内容
- 1.截取字符串 2.匹配字符串从字符串(sd是sfsfsAdfsdf)中查找(匹配)字符串(Ad) 3.分隔字符串...