javascript中去除空格Trim(),LTrim(),RTrim()
// Trim() , Ltrim() , RTrim() 函数
String.prototype.Trim = function()
{
return this.replace(/(^/s*)|(/s*$)/g, "");
}s
String.prototype.LTrim = function()
{
return this.replace(/(^/s*)/g, "");
}
String.prototype.RTrim = function()
{
return this.replace(/(/s*$)/g, "");
}
// Trim() , Ltrim() , RTrim() 函数
String.prototype.Trim = function()
{
return this.replace(/(^/s*)|(/s*$)/g, "");
}s
String.prototype.LTrim = function()
{
return this.replace(/(^/s*)/g, "");
}
String.prototype.RTrim = function()
{
return this.replace(/(/s*$)/g, "");
}