摘要: var str = 'hello world'; //indexOf是在字符串中查找,然后返回需要查找的字符所处的位置,如果字符不存在,返回 -1; str.indexOf('h') // -->输出0;即 h在str字符串里的位置,str.indexOf('w') //-->输出6;毫无疑问; s 阅读全文
posted @ 2017-08-19 11:02 极速代码 阅读(411) 评论(0) 推荐(0)