This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var src = 'AAA <a href="https://baidu.com">abc<b>中国</b>123</a>' | |
var text = src.replace(/<.*?>/ig, '') | |
// or | |
var text = src.replace(/(<([^>]+)>)/ig, '') | |
// result:text="AAA abc中国123" | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 删除 json 字符串中的注释信息 | |
* <p>标准的 json 是不允许带注释的,大部分 json 框架都不支持带注释 json 字符串的解析</p> | |
* @param source 原始 json 字符串 | |
* @return 无注释信息的 json 字符串 | |
*/ | |
public String stripComment(String source) { | |
return source == null ? null : source.replaceAll("\\s*//.*|(?s)\\s*/\\*(.*?)\\*/[ \\t]*", ""); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public Object[] mapRow(ResultSet rs, int rowNum) throws SQLException { | |
Object[] r = new Object[rs.getMetaData().getColumnCount()]; | |
for (int i = 0; i < r.length; i++) { | |
r[i] = rs.getObject(i + 1); | |
} | |
return r; | |
} |