1.String.prototype.Trim = function()
{
}
String.prototype.LTrim = function()
{
}
String.prototype.Rtrim = function()
{
}
2.全文匹配替换
var regExp = new RegExp("需要被替换的字符',"g")
var text = "…………";
text = text.replace(regExp , "替换的字符");
3.方案
String .prototype.trim = function(){
}