Helper.js
547 Bytes
'use strict';
export function removeHTMLTag(str) {
str = str.replace(/<\/?[^>]*>/g,''); //去除HTML tag
str = str.replace(/[ | ]*\n/g,'\n'); //去除行尾空白
//str = str.replace(/\n[\s| | ]*\r/g,'\n'); //去除多余空行
str=str.replace(/ /ig,'');//去掉
str=str.replace(/\s/g,''); //将空格去掉
return str;
}
export function GetQueryString(url,name)
{
var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
var r = url.match(reg);
if(r!=null)return unescape(r[2]); return null;
}