public static int count(String str,String target){
		int count=0; 
		int index=0; 
		while(true){ 
			index=str.indexOf(target,index+1); 
			if(index>0){ 
				count++; 
			}else{ 
				break; 
			} 
		} 
		return count; 
	}
public static int count ( String str , String target ) { int count = 0 ; int index = 0 ; while ( true ) { index = str . indexOf ( target , index + 1 ) ; if ( index > 0 ) { count ++ ; } else { break ; } } return count ; }
统计文本中某个字符串出现的次数
@param str
@param target
@return
下午5:33:24