@Test public void testJoin() { assertEquals("a-b-c", StringUtils.join("-", "a", "b", "c")); assertEquals("", StringUtils.join("-")); }
public static String join(final Iterable<? extends Object> iterable, final String delim) { final StringBuilder sb = new StringBuilder(); if (iterable != null) { final Iterator<? extends Object> iter = iterable.iterator(); if (iter.hasNext()) { final Object next = iter.next(); sb.append(next.toString()); } while (iter.hasNext()) { final Object next = iter.next(); sb.append(delim + next.toString()); } } return sb.toString(); }
StringUtils { public static String join(final Iterable<? extends Object> iterable, final String delim) { final StringBuilder sb = new StringBuilder(); if (iterable != null) { final Iterator<? extends Object> iter = iterable.iterator(); if (iter.hasNext()) { final Object next = iter.next(); sb.append(next.toString()); } while (iter.hasNext()) { final Object next = iter.next(); sb.append(delim + next.toString()); } } return sb.toString(); } }
StringUtils { public static String join(final Iterable<? extends Object> iterable, final String delim) { final StringBuilder sb = new StringBuilder(); if (iterable != null) { final Iterator<? extends Object> iter = iterable.iterator(); if (iter.hasNext()) { final Object next = iter.next(); sb.append(next.toString()); } while (iter.hasNext()) { final Object next = iter.next(); sb.append(delim + next.toString()); } } return sb.toString(); }  }
StringUtils { public static String join(final Iterable<? extends Object> iterable, final String delim) { final StringBuilder sb = new StringBuilder(); if (iterable != null) { final Iterator<? extends Object> iter = iterable.iterator(); if (iter.hasNext()) { final Object next = iter.next(); sb.append(next.toString()); } while (iter.hasNext()) { final Object next = iter.next(); sb.append(delim + next.toString()); } } return sb.toString(); }  static Charset getPreferredCharset(); static boolean isUtf8Supported(); static String join(final Iterable<? extends Object> iterable, final String delim); static String join(final String delimiter, final Object... components); static boolean isNotBlank(final String str); static boolean isBlank(final String str); static String cleanupTags(String tags); static List<String> csvTagsToList(final String tags); static String listToCsvTags(final List<String> tagsList); static String getExceptionStackInfo(final Throwable e); static String unicodeEscape(final String s); static String getMaskedPasswordForDisplay(final String password); static String cleanString(final String stringToClean); static String cleanDetails(final String stringToClean, final String detailsIndexSting); static boolean areTagsEqual(final String tags1, final String tags2); static int formatForOutput(final String text, final int start, final int columns, final char separator); static Map<String, String> stringToMap(final String s); static String mapToString(final Map<String, String> map); static List<T> applyPagination(final List<T> originalList, final Long startIndex, final Long pageSizeVal); }
StringUtils { public static String join(final Iterable<? extends Object> iterable, final String delim) { final StringBuilder sb = new StringBuilder(); if (iterable != null) { final Iterator<? extends Object> iter = iterable.iterator(); if (iter.hasNext()) { final Object next = iter.next(); sb.append(next.toString()); } while (iter.hasNext()) { final Object next = iter.next(); sb.append(delim + next.toString()); } } return sb.toString(); }  static Charset getPreferredCharset(); static boolean isUtf8Supported(); static String join(final Iterable<? extends Object> iterable, final String delim); static String join(final String delimiter, final Object... components); static boolean isNotBlank(final String str); static boolean isBlank(final String str); static String cleanupTags(String tags); static List<String> csvTagsToList(final String tags); static String listToCsvTags(final List<String> tagsList); static String getExceptionStackInfo(final Throwable e); static String unicodeEscape(final String s); static String getMaskedPasswordForDisplay(final String password); static String cleanString(final String stringToClean); static String cleanDetails(final String stringToClean, final String detailsIndexSting); static boolean areTagsEqual(final String tags1, final String tags2); static int formatForOutput(final String text, final int start, final int columns, final char separator); static Map<String, String> stringToMap(final String s); static String mapToString(final Map<String, String> map); static List<T> applyPagination(final List<T> originalList, final Long startIndex, final Long pageSizeVal);  }