List of utility methods to do String Join
String | invertPhoneNumber(String storedNumber, String joinString) invert Phone Number String prefix = String.join("", Arrays.asList("0", storedNumber.substring(2, 4))); String midnumbers, finalnumbers; try { midnumbers = storedNumber.substring(4, 7); finalnumbers = storedNumber.substring(7, 11); } catch (Exception e) { midnumbers = storedNumber.substring(4); finalnumbers = ""; ... |
String | Join(ArrayList This method converts a list of String objects to a single String representation and inserts a delimiter between each object. if (list.isEmpty()) return ""; StringBuilder sb = new StringBuilder(); for (String x : list) sb.append(x + delimiter); sb.delete(sb.length() - delimiter.length(), sb.length()); return sb.toString(); |
String | join(boolean endSlash, Collection join if (paths == null || paths.isEmpty()) { return null; boolean prevLastSlash = false; StringBuilder buffer = new StringBuilder(); for (String param : paths) { if (param == null) continue; ... |
String | join(Collection collection, String separator) Join an collection of objects with a separator that appears after every instance in the list -including at the end return join(collection, separator, true);
|
String | join(Collection> items, String delimiter) Returns all items , concatenated as a string with each of the entries divided by the delimiter .
return join(items, delimiter, 0, items.size());
|
String | join(Enumeration enumeration, String s) join StringBuffer stringbuffer = new StringBuffer(); while (enumeration.hasMoreElements()) { String s1 = (String) enumeration.nextElement(); stringbuffer.append(s1); if (enumeration.hasMoreElements()) { stringbuffer.append(s); return stringbuffer.toString(); |
String | join(Enumeration values, CharSequence separator) Concatenates all of the strings in an Enumeration. StringBuilder builder = new StringBuilder(); CharSequence prefix = ""; while (values.hasMoreElements()) { builder.append(prefix); builder.append(values.nextElement().toString()); prefix = separator; return builder.toString(); ... |
String | join(final Collection Join parts with link. final StringBuilder builder = new StringBuilder(Math.max(300, input.size() * 10)); boolean first = true; for (final Object obj : input) { if (!first) builder.append(link); builder.append(obj.toString()); first = false; return builder.toString(); |
String | join(final String sep, final Iterable Join the given strings, separated by the given separator. final StringBuilder buf = new StringBuilder(); String prefix = ""; for (final String str : strs) { buf.append(prefix).append(str); prefix = sep; return buf.toString(); |
String | join(final String separator, final Collection join if (objs.size() == 0) { return ""; boolean notFirst = false; final StringBuilder ret = new StringBuilder(); for (final Object obj : objs) { if (notFirst) { ret.append(separator); ... |