public static boolean startsWith ( char [ ] src , char [ ] find , int startAt ) { int startPos = startAt ; boolean result = true ; // Check ranges if ( src . length < startPos + find . length ) { result = false ; } else { final int max = find . length ; for ( int a = 0 ; a < max && result ; a ++ ) { if ( src [ startPos ] != find [ a ] ) { result = false ; } startPos ++ ; } } return result ; }
Test whether find can be found at position startPos in the string src .