https://www.runoob.com/jsref/jsref-replace.html
1 2 3 4 5 6 7 8 9 |
<script type="text/javascript"> var str="Welcome to Microsoft! " str=str + "We are proud to announce that Microsoft has " str=str + "one of the largest Web Developers sites in the world." document.write(str.replace(/Microsoft/g, "W3School")) </script> |
1 2 3 4 |
this.dataList = array.map(item => { let data = item.replace(new RegExp(' ', 'g'), '') return data.split('') }) |