specific word count(index of)
specific word count (index of )
<script type="text/javascript">
var str="Hello world!"
document.write(str.indexOf("Hello") + "<br />")
document.write(str.indexOf("World") + "<br />")
document.write(str.indexOf("world"))
</script>
输出结果:
0,
-1,
6
转自:wusifan的博客

浙公网安备 33010602011771号