String nets = "";
if (nets!=null) {
/* 去除 \n 回车(\u000a) \t 水平制表符(\u0009) \s 空格(\u0008)\r 换行(\u000d)*/
Pattern p = Pattern.compile(""\\s*|\t|\r|\n"");
Matcher m = p.matcher(nets);
dest = m.replaceAll("");
}
字符串去除换行、空格
最新推荐文章于 2025-02-22 09:10:18 发布