indexOf()指出字符串的所处位置(整数)

来源:互联网 发布:photo域名 编辑:程序博客网 时间:2024/06/10 01:52
var str="Hello world!"document.write(str.indexOf("Hello") + "<br />")document.write(str.indexOf("World") + "<br />")document.write(str.indexOf("world"))
返回整数,分别是0,-1(因为大小写敏感),6