String (@NotNull String s, @NotNull String suffix, boolean ignoreCase) { boolean endsWith = ignoreCase ? endsWithIgnoreCase(s, suffix) : s.endsWith(suffix); if (endsWith) { return s.substring(0, s.length() - suffix.length()); } return s; }