public static int skipSequence ( char [ ] array , int arrayPos , char [ ] sequence ) { int i ; int j ; for ( i = arrayPos , j = 0 ; i < array . length && j < sequence . length ; i ++ , j ++ ) { if ( array [ i ] != sequence [ j ] ) { break ; } } return j == sequence . length ? i : arrayPos ; }
Skips the specified sequence if it starts from the given position in the character array .