code: public static String removeFileExtension( String filename ) {
  
  		String result = filename;
  		int index = filename.lastIndexOf( '.' );
  		if( index != -1 )
  			result= filename.substring( 0, index );
  
  		return result;
  	}
docs: Removes the extension from a file name.
  @param filename a non-null file name
  @return a non-null string