用js判断一个字符串中某个字符出现的次数

来源:互联网 发布:知世故而不世故 圆滑 编辑:程序博客网 时间:2024/05/22 03:23
<script>var nowpic=0var patt1=new RegExp("t","g");do{result=patt1.exec("The best things in life are free");nowpic++}while (result!=null) document.write(nowpic-1);</script>

0 0