java 去除字符串的换行符

//要去除换行符的字符串
String result = "";
Pattern p = Pattern.compile("\\s*|\t|\r|\n");
Matcher m = p.matcher(result);
result = m.replaceAll("");

猜你喜欢

转载自963084302.iteye.com/blog/2246537