List of utility methods to do Array Join
String | join(String[] stringArray, boolean quote, String glue) join return join(Arrays.asList(stringArray), quote, glue);
|
String | join(String[] stringArray, String delimiter) join String joinedStr = ""; if (stringArray == null || stringArray.length == 0) { return joinedStr; List<String> stringList = Arrays.asList(stringArray); return join(stringList, delimiter); |
String | join(String[] stringArray, String delimiterString, boolean joinNullValues) join List<String> list = new ArrayList<String>(); for (int i = 0; stringArray != null && i < stringArray.length; i++) { list.add(stringArray[i]); return join(list, delimiterString, joinNullValues); |
String | join(String[] stringArray, String separator) Concatenates the Array of Strings into a String using the separator as the delimiter. if (stringArray == null) { return ""; StringBuilder result = new StringBuilder(stringArray.length * 10); boolean needjoin = false; for (String obj : stringArray) { if (needjoin) { result.append(separator); ... |
String | join(String[] strings) join return join(strings, null);
|
String | join(String[] strings, char delimiter) join if (strings == null) { return null; List<String> stringsAsList = Arrays.asList(strings); return join(stringsAsList, delimiter); |
String | join(String[] strings, char delimiter) Join string to a single string using the specified delimiter if (strings == null) { return null; StringBuilder sb = new StringBuilder(); for (int i = 0; i < strings.length; i++) { if (i > 0) { sb.append(delimiter); if (strings[i] != null) { sb.append(strings[i]); return sb.toString(); |
String | join(String[] strings, String glue) join String result = ""; if (glue == null) glue = ","; if (strings != null) { int counter = 0; for (String s : strings) { result += s; counter++; ... |
String | join(String[] strings, String glue) Joins a String[] using glue to separate the elements of the array. StringBuilder builder = new StringBuilder(); for (int i = 0; i < strings.length; i++) { builder.append(strings[i]); if (i != strings.length - 1) { builder.append(glue); return builder.toString(); ... |
String | join(String[] strings, String separator) join if (strings == null) { return null; StringBuilder result = new StringBuilder(); boolean first = true; for (String str : strings) { result.append(first ? "" : separator); result.append(str); ... |