字符串去回车去空格

/**
* 字符串去回车去空格
* @param str
* @return
*/
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;
}

猜你喜欢

转载自dong-android.iteye.com/blog/2207479
今日推荐