@H_301_0@本文实例讲述了javascript字符串对象常用api函数。分享给大家供大家参考,具体如下:@H_4031@
@H3010@1. concat(str1,str2,···)
@H4031@
@H3010@连接字符串@H4031@
@H3010@2. indexOf(str,start)
@H4031@
@H3010@返回 str 在字符串中首次出现的位置@H403_1@
<div class="jb51code">
<pre class="brush:js;">
var str = "hello world";
str.indexOf("hello"); // 0
str.indexOf("o",5); // 7
str.indexOf("World"); // -1