1提取字符串中得数字
public static String getNumeric(String str) {
String regEx="[^0-9]";
Pattern p = Pattern.compile(regEx);
Matcher m = p.matcher(str);
return m.replaceAll("").trim();
}
2 html中图片转换,让剧中显示
public static String getFormatHtml(String content) {
if (!content.contains("");
strBuilder.append("");
strBuilder.append("");
strBuilder.append("无标题文档");
strBuilder.append("");
strBuilder.append("");
strBuilder.append("");
strBuilder.append("");
strBuilder.append("");
strBuilder.append(content.replaceAll("style=", "")); //此处为去掉原始属性。如果想去掉指定标签的style属性,此处需要特殊处理。
strBuilder.append("
");
strBuilder.append("");
strBuilder.append("