※ 字串去除空白
String.prototype.Trim = function() 
{ 
    return this.replace(/(^\s*)|(\s*$)/g, ""); 
} 
String.prototype.LTrim = function() 
{ 
    return this.replace(/(^\s*)/g, ""); 
} 
String.prototype.RTrim = function() 
{ 
    return this.replace(/(\s*$)/g, ""); 
} 
參考網址:
 
沒有留言:
張貼留言