function(str) {
str = dr.ConvertToString(str);
while (/&/.test(str)) {
str = str.replace(/&/, "&");
}
while (/'/.test(str)) {
str = str.replace(/'/, "'");
}
while (/"/.test(str)) {
str = str.replace(/"/, """);
}
while (/</.test(str)) {
str = str.replace(/</, "<");
}
while (/>/.test(str)) {
str = str.replace(/>/, ">");
}
return str;
}
怎么改比较好?这样写会让人觉得正则基础太差.
慕田峪4524236
海绵宝宝撒
随时随地看视频慕课网APP
相关分类