JS代码如下:
/**
*
* @param
* @arrange (512.笔记) jb51.cc
**/
<script type="text/javascript">
var str = "i love china!";
var pattern = /i/g;
var ret = str.replace(pattern,"I");
alert(ret); //I love chIna!
</script>
原文链接:https://www.f2er.com/js/527603.html