通过indexOf()查找某个字符串位置
2008-10-30 14:41
295 查看
AS。的
// 循环直到indexOf()返回-1
while ( ( index = example.indexOf( "cool", index + 1 ) ) != -1 ) {
/* 显示:
String contains word cool at index 30
String contains word cool at index 41
String contains word cool at index 52
*/
trace( "String contains word cool at index " + index );
}
兄弟伙推荐个团购导航
http://www.izhaotuan.com/
// 循环直到indexOf()返回-1
while ( ( index = example.indexOf( "cool", index + 1 ) ) != -1 ) {
/* 显示:
String contains word cool at index 30
String contains word cool at index 41
String contains word cool at index 52
*/
trace( "String contains word cool at index " + index );
}
兄弟伙推荐个团购导航
http://www.izhaotuan.com/
相关文章推荐
- PowerShell中查找字符串位置的IndexOf函数使用实例
- JavaSE8基础 String indexOf 正向 从指定索引值开始查找 字符在字符串中第一次出现的位置
- Qt中indexOf()和lastIndexOf()查找字符串位置
- 通过IndexOf方法来查找对象在ArrayList中的位置
- javascript中indexOf()和lastIndexOf()查找字符串位置
- php通过strpos查找字符串出现位置的方法
- javascript中indexOf()和lastIndexOf()查找字符串位置
- Android Studio:查找文件中含有中文字符串位置
- 通过.IndexOf查找指定的内容实例
- 9.11排序与查找(二)——对字符串数组进行排序,将所有的变位词排在相邻的位置
- Java中字符串中子串的查找共有四种方法(indexof())
- [java practices]查找字符串出现的位置
- 从一个字符串中提取子字符串 /字符串的逆置/查找字符第一次出现的位置
- 在有序但是含有空的字符串中查找最左边特定字符串的位置
- 通过正则表达式查找文本 并检索出匹配正则的字符串内容
- PHP strpos 查找字符串首次出现的位置
- Java的indexOf返回的是第一个匹配到的字符的索引位置,substring(a,b)获得字符串的一部分内容
- Shell脚本实现查找字符串中某字符最后出现的位置
- WPF的RichTextBox中查找字符串位置
- 关于SQL中查找字符串的总结 PATINDEX CHARINDEX 返回字符串中第N次出现指定字符串位置