@Test public void joinOnSkipNull() throws Exception { assertThat(StringUtils.joinOnSkipNullOrEmpty("+", "1", null, "3")).isEqualTo("1+3"); }
public static String joinOnSkipNullOrEmpty(String delimiter, @NotNull String ... strings) { StringBuilder sb = new StringBuilder(); int i = 0; for (String string : strings) { if (string == null || string.isEmpty()) { continue; } if (i != 0) { sb.append(delimiter); } sb.append(string); ++i; } return sb.toString(); }
StringUtils { public static String joinOnSkipNullOrEmpty(String delimiter, @NotNull String ... strings) { StringBuilder sb = new StringBuilder(); int i = 0; for (String string : strings) { if (string == null || string.isEmpty()) { continue; } if (i != 0) { sb.append(delimiter); } sb.append(string); ++i; } return sb.toString(); } }
StringUtils { public static String joinOnSkipNullOrEmpty(String delimiter, @NotNull String ... strings) { StringBuilder sb = new StringBuilder(); int i = 0; for (String string : strings) { if (string == null || string.isEmpty()) { continue; } if (i != 0) { sb.append(delimiter); } sb.append(string); ++i; } return sb.toString(); }  }
StringUtils { public static String joinOnSkipNullOrEmpty(String delimiter, @NotNull String ... strings) { StringBuilder sb = new StringBuilder(); int i = 0; for (String string : strings) { if (string == null || string.isEmpty()) { continue; } if (i != 0) { sb.append(delimiter); } sb.append(string); ++i; } return sb.toString(); }  static boolean isNumeric(@NotNull String str); static String joinOn(String delimiter, @NotNull Object array[]); static String joinOn(String delimiter, @NotNull Collection<String> strings); static String joinOn(String delimiter, @NotNull String ... strings); static String joinOnSkipNullOrEmpty(String delimiter, @NotNull String ... strings); @NotNull static String nullToEmpty(@Nullable String value); @NotNull static String[] singletonArrayOrEmpty(@Nullable String value); @NotNull static String whitespace(int indent); @NotNull static String safeFormat(@NotNull String format, Object ... args); static boolean containsAny(@NotNull String value, @NotNull String chars); @NotNull static String firstAvailable(@NotNull String value, int n); static boolean startsWithAny(@NotNull String value, @NotNull String chars); }
StringUtils { public static String joinOnSkipNullOrEmpty(String delimiter, @NotNull String ... strings) { StringBuilder sb = new StringBuilder(); int i = 0; for (String string : strings) { if (string == null || string.isEmpty()) { continue; } if (i != 0) { sb.append(delimiter); } sb.append(string); ++i; } return sb.toString(); }  static boolean isNumeric(@NotNull String str); static String joinOn(String delimiter, @NotNull Object array[]); static String joinOn(String delimiter, @NotNull Collection<String> strings); static String joinOn(String delimiter, @NotNull String ... strings); static String joinOnSkipNullOrEmpty(String delimiter, @NotNull String ... strings); @NotNull static String nullToEmpty(@Nullable String value); @NotNull static String[] singletonArrayOrEmpty(@Nullable String value); @NotNull static String whitespace(int indent); @NotNull static String safeFormat(@NotNull String format, Object ... args); static boolean containsAny(@NotNull String value, @NotNull String chars); @NotNull static String firstAvailable(@NotNull String value, int n); static boolean startsWithAny(@NotNull String value, @NotNull String chars);  }