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