public static int verifyOrder(String input,String[] subStrings){
  int prev=-1;
  for (int i=0; i < subStrings.length; i++) {
    int current=input.indexOf(subStrings[i]);
    if (current < prev) {
      return i;
    }
 else {
      prev=current;
    }
  }
  return -1;
}

public static int verifyOrder ( String input , String [ ] subStrings ) { int prev = - 1 ; for ( int i = 0 ; i < subStrings . length ; i ++ ) { int current = input . indexOf ( subStrings [ i ] ) ; if ( current < prev ) { return i ; } else { prev = current ; } } return - 1 ; }
verify that the list of substrings appear in the order provided in a string
