code: public int indexOf(UTF8String v, int start) {
      if (v.numBytes() == 0) {
        return 0;
      }
  
      // locate to the start position.
      int i = 0; // position in byte
      int c = 0; // position in character
      while (i < numBytes && c < start) {
        i += numBytesForFirstByte(getByte(i));
        c += 1;
      }
  
      do {
        if (i + v.numBytes > numBytes) {
          return -1;
        }
        if (ByteArrayMethods.arrayEquals(base, offset + i, v.base, v.offset, v.numBytes)) {
          return c;
        }
        i += numBytesForFirstByte(getByte(i));
        c += 1;
      } while (i < numBytes);
  
      return -1;
    }
docs: Returns the position of the first occurrence of substr in
  current string from the specified position (0-based index).
  
  @param v the string to be searched
  @param start the start position of the current string for searching
  @return the position of the first occurrence of substr, if not found, -1 returned.