public int countIn(CharSequence sequence){
  int count=0;
  for (int i=0; i < sequence.length(); i++) {
    if (matches(sequence.charAt(i))) {
      count++;
    }
  }
  return count;
}

public int countIn ( CharSequence sequence ) { int count = 0 ; for ( int i = 0 ; i < sequence . length ( ) ; i ++ ) { if ( matches ( sequence . charAt ( i ) ) ) { count ++ ; } } return count ; }
returns the number of matching characters found in a character sequence .
