将用空格,跳格,回车隔开的字符串,转化成以逗号(,)隔开
function Replacing(strInput)
{
var strResult = "";
strResult = strInput.replaceAll("\t",",");
strResult = strResult.replaceAll("\r",",");
strResult = strResult.replaceAll("\n",",");
strResult = strResult.replaceAll(" ",",");
return strResult;
}
//很严重的问题,原来少了这么一小段。自定义一个replaceAll函数。
String.prototype.replaceAll = function(s1,s2)
{
return this.replace(new RegExp(s1,"gm"),s2);
}
浙公网安备 33010602011771号