question: public int indexOf ( java . lang . String subString , int start ) { if ( start < 0 ) { start = 0 ; } int subCount = subString . count ; int _count = count ; if ( subCount > 0 ) { if ( subCount + start > _count ) { return - 1 ; } char [ ] target = subString . value ; int subOffset = subString . offset ; char firstChar = target [ subOffset ] ; int end = subOffset + subCount ; while ( true ) { int i = indexOf ( firstChar , start ) ; if ( i == - 1 || subCount + i > _count ) { return - 1 ; } int o1 = offset + i , o2 = subOffset ; char [ ] _value = value ; while ( ++ o2 < end && _value [ ++ o1 ] == target [ o2 ] ) { } if ( o2 == end ) { return i ; } start = i + 1 ; } } return start < _count ? start : _count ; }
target:  Returns the index within this string of the first occurrence of the specified substring, starting at the specified index. The integer returned is the smallest value such that: this.startsWith(str, ) && ( >= fromIndex) is true. There is no restriction on the value of fromIndex. If it is negative, it has the same effect as if it were zero: this entire string may be searched. If it is greater than the length of this string, it has the same effect as if it were equal to the length of this string: -1 is returned.