This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015. Learn moreSee full compatibilityReport feedback replace() は String 値のメソッドで、pattern に一致する文字列の一部またはすべてを replacement で置き換えた新しい文字列を返します。pattern には文字列または正規表現 (RegExp) を指定することができ、 replacement には文字列または一致するごとに呼び出される関数を指定することができます。pattern が文字列の場合、最初に一致した箇所のみを置き換えます。元の文字列
![String.prototype.replace() - JavaScript | MDN](https://cdn-ak-scissors.b.st-hatena.com/image/square/9e272e7450bf4ba0ddcb0c4c3ad37a33c071280f/height=288;version=1;width=512/https%3A%2F%2Ffanyv88.com%3A443%2Fhttps%2Fdeveloper.mozilla.org%2Fmdn-social-share.d893525a4fb5fb1f67a2.png)