当前位置: 移动技术网 > IT编程>开发语言>JavaScript > js replaceAll的实现代码教程

js replaceAll的实现代码教程

2019年03月23日  | 移动技术网IT编程  | 我要评论

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>   

如对本文有疑问, 点击进行留言回复!!

相关文章:

验证码:
移动技术网