public static String stripExtension(String filename){
  int idx=filename.indexOf('.');
  if (idx != -1) {
    filename=filename.substring(0,idx);
  }
  return filename;
}

public static String stripExtension ( String filename ) { int idx = filename . indexOf ( '.' ) ; if ( idx != - 1 ) { filename = filename . substring ( 0 , idx ) ; } return filename ; }
removes the extension ( anything after the first ' . ' ) , otherwise returns the original filename .
