code: private String removeExtension(String string) {
  		String pathWithoutExtension = string;
  		int dotIndex = string.lastIndexOf('.');
  		if (dotIndex > 0) {
  			pathWithoutExtension = string.substring(0, dotIndex);
  		}
  		return pathWithoutExtension;
  	}
docs: Removes every character after '?'.
  
  @param string
  String.
  @return The received string or everything before a '?' character.