자바스크립트에서 문자열을 교체하려면 replace() 메서드를 사용하십시오 -
<html> <body> <script> var str1 = 'John loves studying. He loves Football too!'; var str2 = str1.replace(/loves/g, "likes"); document.write(str2); </script> </body> </html>
자바스크립트에서 문자열을 교체하려면 replace() 메서드를 사용하십시오 -
<html> <body> <script> var str1 = 'John loves studying. He loves Football too!'; var str2 = str1.replace(/loves/g, "likes"); document.write(str2); </script> </body> </html>