question: public static String removeFileExtension ( String s ) { String separator = System . getProperty ( "file.separator" ) ; String filename ; int lastSeparatorIndex = s . lastIndexOf ( separator ) ; if ( lastSeparatorIndex == - 1 ) { filename = s ; } else { filename = s . substring ( lastSeparatorIndex + 1 ) ; } return filename ; }
target:  Removes the file extension.