function whole2half(text)
{
var txt = "";
for(var i=0; ivar c = text.charCodeAt(i);
if (c >= 0xff01 && c <= 0xff5e) // ASCII 0x21 - 0x7e
txt += String.fromCharCode(0x21 + c - 0xff01);
else if(c == 0x3000) //space
txt += " ";
else
txt += text.charAt(i);
}
return txt;
}
订阅:
博文评论 (Atom)
没有评论:
发表评论