public static String stripFileExtension(String name){
  int pos=name.lastIndexOf('.');
  if (pos > 0 & pos < name.length() - 1)   return name.substring(0,pos);
  return name;
}

public static String stripFileExtension ( String name ) { int pos = name . lastIndexOf ( '.' ) ; if ( pos > 0 & pos < name . length ( ) - 1 ) return name . substring ( 0 , pos ) ; return name ; }
remove the extension from the file name . this function does not check if the file exists .
