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