JScript方法-lastIndexOf方法
来源:互联网 发布:mac文件夹删除快捷键 编辑:程序博客网 时间:2024/05/02 18:09
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 728x15, 创建于 08-4-23MSDN */google_ad_slot = "3624277373";google_ad_width = 728;google_ad_height = 15;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
strobj.lastindexof(substring[, startindex])
参数
strobj
必选项。string 对象或文字。
substring
必选项。要在 string 对象内查找的子字符串。
startindex
可选项。该整数值指出在 string 对象内进行查找的开始索引位置。如果省略,则查找从字符串的末尾开始。
说明
lastindexof 方法返回一个整数值,指出 string 对象内子字符串的开始位置。如果没有找到子字符串,则返回 -1。
如果 startindex 是负数,则 startindex 被当作零。如果它比最大字符位置索引还大,则它被当作最大的可能索引。
从右向左执行查找。否则,该方法和 indexof 相同。
下面的示例说明了 lastindexof 方法的用法:
function lastindexdemo(str2)
{
var str1 = "babebibobubabebibobu"
var s = str1.lastindexof(str2);
return(s);
}
要求
版本 1
<<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 728x15, 创建于 08-4-23MSDN */google_ad_slot = "3624277373";google_ad_width = 728;google_ad_height = 15;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 160x600, 创建于 08-4-23MSDN */google_ad_slot = "4367022601";google_ad_width = 160;google_ad_height = 600;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
返回 string 对象中子字符串最后出现的位置。strobj.lastindexof(substring[, startindex])
参数
strobj
必选项。string 对象或文字。
substring
必选项。要在 string 对象内查找的子字符串。
startindex
可选项。该整数值指出在 string 对象内进行查找的开始索引位置。如果省略,则查找从字符串的末尾开始。
说明
lastindexof 方法返回一个整数值,指出 string 对象内子字符串的开始位置。如果没有找到子字符串,则返回 -1。
如果 startindex 是负数,则 startindex 被当作零。如果它比最大字符位置索引还大,则它被当作最大的可能索引。
从右向左执行查找。否则,该方法和 indexof 相同。
下面的示例说明了 lastindexof 方法的用法:
function lastindexdemo(str2)
{
var str1 = "babebibobubabebibobu"
var s = str1.lastindexof(str2);
return(s);
}
要求
版本 1
<<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 728x15, 创建于 08-4-23MSDN */google_ad_slot = "3624277373";google_ad_width = 728;google_ad_height = 15;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 160x600, 创建于 08-4-23MSDN */google_ad_slot = "4367022601";google_ad_width = 160;google_ad_height = 600;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
- JScript方法-lastIndexOf方法
- javaScript的lastIndexOf()方法
- Java lastIndexOf 、indexOf方法
- Java lastIndexOf 、indexOf方法
- Java lastIndexOf 、indexOf方法
- Java lastIndexOf 、indexOf方法
- String.LastIndexOf 方法 (Char)
- Java lastIndexOf 、indexOf方法
- JScript方法-anchor方法
- JScript方法-big方法
- JScript方法-blink方法
- JScript方法-bold方法
- JScript方法-charAt方法
- JScript方法-charCodeAt方法
- JScript方法-compile方法
- JScript方法-dimensions方法
- JScript方法-escape方法
- JScript方法-eval方法
- JScript方法-indexOf方法
- SwingX: Translucent Panels 101
- JScript方法-italics方法
- Java Community Process 2.6: The JCP Evolves Again @ JDJ
- JScript方法-join方法
- JScript方法-lastIndexOf方法
- Linux Business Week News @ JDJ
- JScript方法-lbound方法
- Open Source Development (This Article Is the Winner of PRSA 2003 Award in Excellence in Technology …
- JScript方法-link方法
- MAX: A Java-Based Personal Robot Platform @ JDJ
- JScript方法-localeCompare方法
- JScript中正则表达函数的说明与应用
- Registering a Web Service in UDDI @ JDJ