您的位置:首页 > 其它

replaceAll替换空格和回车

2016-12-28 10:31 169 查看
有这个一个任务,用户在停保的时候降停保原因写成加空格和回车的话,再次新申请审批的时候不能带出信息,所以要将停保原因中的回车符去掉,加了两行代码:

stopreason =stopAll.getReason();
stopreason = stopreason.replaceAll("(\r\n|\r|\n|\n\r)", "");//去掉回车
stopreason = stopreason.replaceAll("\\s", ""); //去掉空格
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: