string.prototype.trim = function()
{
return this.replace(/(^[\s]*)|([\s]*$)/g, );
}
以上的這個方法是通過正則表達式來去除文本內容的空格
版權所有:易賢網