public int indexOf(java.lang.String string){
  int start=0;
  int subCount=string.count;
  int _count=count;
  if (subCount > 0) {
    if (subCount > _count) {
      return -1;
    }
    char[] target=string.value;
    int subOffset=string.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;
}

public int indexOf ( java . lang . String string ) { int start = 0 ; int subCount = string . count ; int _count = count ; if ( subCount > 0 ) { if ( subCount > _count ) { return - 1 ; } char [ ] target = string . value ; int subOffset = string . 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 ; }
returns the index within this string of the first occurrence of the specified substring . the integer returned is the smallest value such that : this . startswith ( str , ) is true .
