js replaceAll的实现代码教程
程序员文章站
2022-06-30 09:29:34
js replaceall的实现代码教程
...
js replaceall的实现代码教程
<!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>js replaceall的实现</title> <style type="text/css"> </style> </head> <body> <script src="https://cdn.bootcss.com/jquery/3.2.1/jquery.js"></script> <script type="text/javascript"> var s = 'xu同保xu' s = s.replace(new regexp('xu',"gm"), '徐'); console.log(s); </script> </body> </html>