List of utility methods to do List to String
String | toString(List to String if (input.isEmpty()) return ""; String result = input.get(0); for (int i = 1; i < input.size(); i++) { result += sep + input.get(i); return result; |
String | toString(List Forms the StringList into a normal sentence with Spaces return toString(list.toArray(new String[list.size()])); |
String | toString(List to String String result = ""; for (int i = 0; i < list.size(); i++) { if (list.size() == 2 && i == 1) { result += " and "; } else if (list.size() > 2 && i == list.size() - 1) { result += ", and "; } else if (i != 0) { result += ", "; ... |
String | toString(List to String String argumentString = ""; Iterator<String> iterator2 = list.iterator(); for (int i = 0; iterator2.hasNext(); i++) { String argument = iterator2.next(); if (i > 0) argumentString += delimiter; argumentString += argument; return argumentString; |
String | toString(List to String StringBuffer sbuf = new StringBuffer(); for (int i = 0; i < list.size(); i++) { if (i > 0) { sbuf.append(split); sbuf.append(list.get(i)); return sbuf.toString(); ... |
String | toString(List to String final String SEPARATOR = ","; final StringBuilder stringBuilder = new StringBuilder(); for (final String string : strings) { if (stringBuilder.length() != 0) { stringBuilder.append(SEPARATOR).append(' '); stringBuilder.append(string); return stringBuilder.toString(); |
String | toString(List to String if (strings.isEmpty()) { return null; StringBuilder builder = new StringBuilder(); Iterator<String> iterator = strings.iterator(); while (iterator.hasNext()) { builder.append(iterator.next()); if (iterator.hasNext()) { ... |
String | toString(List Convert to string a list of T objects. return list == null ? "null" : Arrays.toString(list.toArray()); |
String | toString(List to String StringBuilder buf = new StringBuilder(); int k = -1; for (T t : list) { if (++k > 0) { buf.append(", "); buf.append(t); return buf.toString(); |
String | toString(List to String StringBuilder stringBuilder = new StringBuilder(); if (list.size() == 1) { stringBuilder.append(list.get(0)); } else if (list.size() == 2) { stringBuilder.append(list.get(0) + " and " + list.get(1)); } else if (list.size() > 0) { stringBuilder.append(list.get(0)); for (int i = 1; i < list.size() - 1; i++) { ... |