返回第二个参数在第一个参数中最后一次出现的位置。 如果没有匹配项,则返回–1。
字符串
lastIndexOf(<parameters>)
lastIndexOf(<string>,<string>)
返回整数。
lastIndexOf("Hello, "l")
返回3。
解释:
在“Hello”中,“l”的最后一次出现在位置3。