1.字符串去除空格
var result=this.article.replace(/\s/g,"");
2.带标签的字段串去除标签
return str.replace(/(?<=<p>)(\s{2})|<p[^>]+><\/p>/g,"");
1.字符串去除空格
var result=this.article.replace(/\s/g,"");
2.带标签的字段串去除标签
return str.replace(/(?<=<p>)(\s{2})|<p[^>]+><\/p>/g,"");