js正則批量替換字符串-字符串批量替換

let str =  "sdfsfwwxxxfsfsxxdsdfwsdfxxxxa3sdswexxxxsdfsxxxxfa"字符串 let newStr = str.replace(new RegExp(/xxx/g), "YYY") console console.log(newStr)     //"sdfsfwwYYYfsfsxxdsdfwsdfYYYxa3sdsweYYYxsdfsYYYx
相關文章
相關標籤/搜索