要替换JavaScript中出现的字符串,请使用replace()方法-
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>
友情链接: json在线解析 通晓查询 糯晒黄历 姓名打分