List of utility methods to do List to String
String | convertListToStringWithSeparator(List convert List To String With Separator StringBuilder result = new StringBuilder(); Iterator<String> iter = myList.iterator(); while (iter.hasNext()) { String item = iter.next(); result.append(item); if (iter.hasNext()) { result.append(separator); return result.toString(); |
String | listToStr(Collection a, char sep) list To Str return listToStr(a, String.valueOf(sep));
|
String | listToStr(Collection list To Str StringBuilder sb = new StringBuilder(); int a = 0; for (Iterator<TypeName> i = c.iterator(); i.hasNext();) { TypeName s = i.next(); sb.append(s); if (++a >= c.size()) break; sb.append(delim); ... |
String | listToStr(List Return a string containing the comma-delimited string representation of the input list. StringBuilder sb = new StringBuilder(); formatList(sb, lst); return sb.toString(); |
String | listToStr(List list To Str StringBuilder sb = new StringBuilder(); for (String s : list) { sb.append(s); sb.append("\n"); return sb.toString(); |
String | listToStr(List list To Str StringBuffer result = new StringBuffer(); int size = stringList.size(); for (int i = 0; i < size; i++) { String s = stringList.get(i); result.append(s); if (i < size - 1) { result.append(","); return result.toString(); |
String[] | listToStrArray(List list) list To Str Array if (list != null) { String curStr[] = new String[list.size()]; int n = 0; for (Iterator j = list.iterator(); j.hasNext(); n++) { curStr[n] = (String) j.next(); return curStr; return null; |
String | listToString(final List> l) list To String return Arrays.toString(l.toArray());
|
String | listToString(Collection Returns a space seperated string from a string collection. Iterator<String> items = col.iterator(); StringBuilder sb = new StringBuilder(); while (items.hasNext()) { sb.append(items.next().trim()).append(" "); sb.deleteCharAt(sb.length() - 1); return sb.toString(); |
String | listToString(Collection list To String StringBuffer result = new StringBuffer(); if (l != null) { Iterator<String> iter = l.iterator(); while (iter.hasNext()) { String s = (String) iter.next(); result.append(s); if (iter.hasNext()) { result.append(","); ... |