List of utility methods to do String Join
String | join(final String separator, final String... strings) join String output = ""; for (int i = 0; i < strings.length; i++) { String s = strings[i]; output += s; if (i < strings.length - 1) { output += separator; return output; |
String | join(final String... arguments) join return join(isEmpty((Object[]) arguments) ? null : Arrays.asList(arguments), SPACE);
|
String | join(HashMap join if (separator == null || separator.equalsIgnoreCase("")) { throw new IllegalArgumentException("Missing separator!"); String output = ""; if (params != null) { for (String name : params.keySet()) { if (output.length() > 0) { output = output + separator; ... |
String | join(Iterable extends Object> arr, String delimeter) Concatenate a list of values together as a string. StringBuilder str = new StringBuilder(); boolean first = true; for (Object ob : arr) { if (first) { first = false; } else { str.append(delimeter); str.append(ob); return str.toString(); |
String | join(Iterable Returns a comma-separated join of the strings in the input. StringBuilder builder = new StringBuilder(); for (String item : input) { builder.append(item).append(", "); if (builder.length() >= 2) { builder.setLength(builder.length() - 2); return builder.toString(); ... |
String | join(java.util.Collection> strings, String delimiter) Returns a string representation of 'strings' which contains all elements of 'strings' separated by 'delimiter'. StringBuilder ans = new StringBuilder(); boolean first = true; for (Object s : strings) { if (first) first = false; else ans.append(delimiter); ans.append(s); ... |
List | join(Map join if (map == null) { return null; List<String> list = new ArrayList<String>(); if (map == null || map.size() == 0) { return list; for (Map.Entry<String, String> entry : map.entrySet()) { ... |
String | join(String connector, Object... objects) join StringBuffer sBuffer = new StringBuffer(); for (Object object : objects) { sBuffer.append(object).append(connector); if (sBuffer.length() > 0) { sBuffer.delete(sBuffer.length() - connector.length(), sBuffer.length()); return sBuffer.toString(); ... |
String | join(String delim, List join StringBuilder builder = new StringBuilder(); if (strings != null) { for (String str : strings) { if (builder.length() > 0) { builder.append(delim).append(" "); builder.append(str); return builder.toString(); |
String | join(String delim, Object... objects) Join a list of non-null objects with delim and return it as a string.
final StringBuilder b = new StringBuilder(); for (Object s : objects) { if (s != null) { if (b.length() > 0) b.append(delim); b.append(s.toString()); return b.toString(); |