List of utility methods to do String Implode
String | implode(char delimiter, char escape, String... input) Combine multiple Strings into one using the specified delimiter and the specified escape character. boolean first = true; StringBuilder result = new StringBuilder(); for (String str : input) { if (!first) { result.append(delimiter); } else { first = false; result.append(escape(str, escape, Character.toString(delimiter))); return result.toString(); |
String | implode(final char separator, final Object... array) Join array elements with a string. return implode(array, separator);
|
String | implode(final String separator, final Iterable implode final StringBuilder sb = new StringBuilder(); for (String iterable : data) { sb.append(iterable).append(separator); return sb.substring(0, sb.length() - separator.length()); |
String | implode(Object strarr[], String delim) Same as implode(Iterable strarr, String delim), but taking an array instead of an Iterable object. String res = ""; String del = ""; int i = 0; for (Object c : strarr) { i++; if (i > 1) del = delim; res += (del + c.toString()); ... |
String | implode(Object[] data, String delimiter) implode String implodedString; if (data.length == 0) { implodedString = EMPTY; } else { StringBuffer sb = new StringBuffer(); sb.append(data[0]); for (int i = 1; i < data.length; i++) { sb.append(delimiter); ... |
String | implode(Object[] elements, String delimiter) Combines an array to a string, using the specified delimiter. StringBuffer buffer = new StringBuffer(""); for (int i = 0; i < elements.length - 1; i++) { buffer.append((String) elements[i] + delimiter); buffer.append((String) elements[elements.length - 1]); return buffer.toString(); |
String | implode(Object[] source, String delimiter) implode StringBuilder sb = new StringBuilder(source[0].toString()); for (int i = 1; i < source.length; i++) { if (source[i] == null) break; sb.append(delimiter); sb.append(source[i].toString()); return sb.toString(); ... |
String | implode(String delim, Object[] array) Joins array elements in a String. String asImplodedString; if (array.length == 0) { asImplodedString = ""; } else { StringBuilder sb = new StringBuilder(); sb.append(array[0]); for (int i = 1; i < array.length; i++) { sb.append(delim); ... |
String | implode(String delimiter, String[] strings) This method merges an array of strings to a single string if (strings.length == 0) { return ""; } else { StringBuilder sb = new StringBuilder(strings[0]); for (int i = 1; i < strings.length; i++) { sb.append(delimiter).append(strings[i]); return sb.toString(); ... |
String | implode(String glue, String... parts) implode if ((glue == null) || (parts.length <= 0)) { return ""; String string = parts[0]; for (int i = 1; i < parts.length; i++) { string += glue + parts[i]; return string; ... |