JS中replace所有替換

 今天遇到一個問題,用replace只能替換一個字符,不能替換字符串中的所有字符,在網上找了好久也沒找到答案,有的說用:this String.prototype.replaceAll = function (FindText, RepText) {         let regExp = new RegExp(FindText, 'g');         return this.replac
相關文章
相關標籤/搜索