code: public static String removeExtension(String fileName) {
  		final String separator = FILE_SEPARATOR;
  		String filename;
  		// Remove the path upto the filename.
  		final int lastSeparatorIndex = fileName.lastIndexOf(separator);
  		if (lastSeparatorIndex == -1) {
  			filename = fileName;
  		} else {
  			filename = fileName.substring(lastSeparatorIndex + 1);
  		}
  
  		// Remove the extension.
  		final int extensionIndex = filename.lastIndexOf(".");
  		if (extensionIndex == -1) {
  			return filename;
  		}
  		fileName = fileName.substring(0, lastSeparatorIndex);
  		return fileName + File.separator + filename.substring(0, extensionIndex);
  	}
docs: Removes the extension.
  
  @param fileName the file name
  @return the string