String removeExtension(String filename){
  int dotIndex=filename.lastIndexOf(".");
  return (dotIndex == -1) ? filename : filename.substring(0,dotIndex);
}

String removeExtension ( String filename ) { int dotIndex = filename . lastIndexOf ( "." ) ; return ( dotIndex == - 1 ) ? filename : filename . substring ( 0 , dotIndex ) ; }
returns the file name without its file extension .
