code: private int find_extension()
  {
      int lastSlashIndex;
  
      final StringBuilder str = mString;
      // only look at the filename
      lastSlashIndex = str.lastIndexOf(File.pathSeparator);
      if (lastSlashIndex == -1) {
        lastSlashIndex = 0;
      } else {
        lastSlashIndex++;
      }
      // find the last dot
      return str.lastIndexOf(".", lastSlashIndex);
  }
docs: /*
  Helper function for finding the start of an extension in a pathname.
  
  Returns a index inside mString, or -1 if no extension was found.