确定字符串中、出现特定字符串的次数
摘要:
var s:String = "hellojavaeoojavapopejava";//不这样做会改变原来的字符串svar _s:String = s;var s1:String = "java";var index,count:int = 0;while (_s.indexOf(s1)!=-1){ index = _s.indexOf(s1); trace(index) _s = _s.substring(index + s1.length); count++;}trace("字符串出现次数---"+count);trace(s); 阅读全文