换行符的替换
Model.prototype.replace = function(str) {
str=str+'';//问题解决的关键点
str=str.replace(/\r\n/ig,"<br/>");
return str;
};
特殊字符的替换,比如替换双引号
Model.prototype.replace = function(str) {
str=str.replace(/\"/ig,"");
return str;
};
换行符的替换
Model.prototype.replace = function(str) {
str=str+'';//问题解决的关键点
str=str.replace(/\r\n/ig,"<br/>");
return str;
};
特殊字符的替换,比如替换双引号
Model.prototype.replace = function(str) {
str=str.replace(/\"/ig,"");
return str;
};
评一波