String (String file) { int ind = -1; for (String ext : EGG_EXTENSIONS) { ind = file.indexOf(ext + "!"); if (ind != -1) break; } if (ind != -1) { return file.substring(0, ind + 4) + file.substring(ind + 5); } else { return file; } }