[JQuery]去除字符串中的所有空格
- 开发笔记
- 2008-09-18
- 63热度
- 0评论
[code]
function IgnoreSpaces(Str){
var ResultStr = "";
Temp=Str.split(" "); //双引号之间是个空格;
for(i = 0; i < Temp.length; i++)
ResultStr +=Temp[i];
alert(ResultStr);
return ResultStr;
}
[/code]
[code]
function IgnoreSpaces(Str){
var ResultStr = "";
Temp=Str.split(" "); //双引号之间是个空格;
for(i = 0; i < Temp.length; i++)
ResultStr +=Temp[i];
alert(ResultStr);
return ResultStr;
}
[/code]