js indexOf("") toUpperCase()

来源:互联网 发布:php中面向对象的机制 编辑:程序博客网 时间:2024/05/16 02:42

 indexOf("")


<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
 


toUpperCase()转换为大写 !