在线手册

  • jsref lastindexof

    ... Example Search a string for the last occurrence of "planet", starting the search at position 20: var str = "Hello planet earth, you are a great planet."; var n = str.lastIndexOf("planet", 20); The result of n will be ...

  • jsref lastindexof

    ... 对象 实例 查找字符串 "planet" 最后出现的位置: var str="Hello planet earth, you are a great planet."; var n=str.lastIndexOf("planet"); n 输出结果: var str="Hello planet earth, you are a great planet."; document.write(str.lastIndexOf("planet")); 尝试一下 » 定义和用法 ...

  • jsref regexp compile

    ... " with "person", with the compile() method: var str="Every man in the world! Every woman on earth!"; var patt=/man/g; var str2=str.replace(patt,"person"); document.write(str2+"<br>"); patt ...

  • jsref regexp compile

    ... 式,用 "person" 替换 "man" 或 "woman",: <script> var str="Every man in the world! Every woman on earth!"; var patt=/man/g; var str2=str.replace(patt,"person"); document.write(str2+"<br>"); patt=/(wo)?man/g; patt.compile(patt); str2 ...

推广服务(新)
最新文章