private boolean containsCharsInOrder(String name,String query){
  int iName=0, iQuery=0;
  while (iName < name.length() && iQuery < query.length()) {
    if (name.charAt(iName) == query.charAt(iQuery)) {
      iName++;
      iQuery++;
    }
 else {
      iName++;
    }
  }
  return iQuery == query.length();
}

private boolean containsCharsInOrder ( String name , String query ) { int iName = 0 , iQuery = 0 ; while ( iName < name . length ( ) && iQuery < query . length ( ) ) { if ( name . charAt ( iName ) == query . charAt ( iQuery ) ) { iName ++ ; iQuery ++ ; } else { iName ++ ; } } return iQuery == query . length ( ) ; }
check if name contains all the characters of query in order . for example , name ' foobar ' contains query ' fb ' , but not ' bf '
