string.prototype.trim = function()
{
return this.replace(/(^[\s]*)|([\s]*$)/g, );
}
以上的這個方法是通過正則表達式來去除文本內容的空格
2026上岸·考公考編培訓報班