标签:ar sp c new r bs as har 字符串
package 字符串2;
public class TestString {
public static void main(String[] args) { String str = "Returns a new character sequence that is a subsequence of this sequence"; int count = 0; int index = 0; String strTofind = "sequence"; while((index = str.indexOf(strTofind))!=-1){ count++; str = str.substring(index+strTofind.length()); } System.out.println("str字符串中所含的sequence子串的个数:"+count); }
}
标签:ar sp c new r bs as har 字符串
原文地址:http://www.cnblogs.com/oraclespace/p/3983308.html