怎么用thymeleaf 实现替换换行符和空格?将例子1变成例子2的样子展示
使用正则的话模板报错不行${#strings.replace(entity.blnr, /\n/,'')}
这样也不管用${#strings.replace(entity.blnr, ' ','')}
例子1
问:123
答:123
问:123
例子2
问:123 答:123 问:123
String blnr_str=wsobject.getBiluneirong().trim().replaceAll("[\r\n]+", "");
blnr_str=blnr_str.replaceAll("[ ]+", "");
blnr_str=blnr_str.replaceAll("问:", "\r\n 问:");
blnr_str=blnr_str.replaceAll("问:", "\r\n 问:");
blnr_str=blnr_str.replaceAll("答:", "\r\n 答:");
blnr_str=blnr_str.replaceAll("答:", "\r\n 答:");