「javaScript」String.prototype.replace()で全置換をするサンプル

JSコード
const str = “tokyo,oosaka,fukuoka,yokohama";
const replaced =str.replace(/,/g,’ ')
console.log(replaced)

結果
tokyo oosaka fukuoka yokohama

JavaScript

Posted by arkgame