<title>string对象 </title>
<script type="text/javascript">
var mystr="Hello World!"
document.write(mystr.indexOf("o",7));
</script>都是对的,没问题啊。mystr.indexOf("o",6) 6代表开始检索位,不是只检索第6个字符。
那是对的,startpos是指从0到length-1这些中间开始检索的
都是对的,你是:从第6个或者第7个位置起,检索“o”的位置。第二个“o”的下标为7。空格也占位
mystr 调用了indexof方法