Java Utililty Methods List to String

List of utility methods to do List to String

Description

The list of methods to do List to String are organized into topic(s).

Method

ListtoStringList(List list)
to String List
List result = new ArrayList(list.size());
Object obj;
for (int i = 0; i < list.size(); i++) {
    obj = list.get(i);
    if (obj != null) {
        result.add(obj.toString());
return result;
StringtoStringList(List list)
to String List
if (list.isEmpty())
    return ("\tNO ITEM !!");
StringBuilder sb = new StringBuilder();
for (int i = 0; i < list.size(); i++) {
    sb.append(list.get(i) + "\n");
return sb.toString();
ListtoStringList(List source)
Converts a list of objects to a list of their string equivalents.
List<String> dest = new ArrayList<String>(source.size());
for (Object value : source) {
    dest.add(value.toString());
return dest;
ListtoStringList(List intList)
to String List
List<String> stringList = new ArrayList<>();
for (Integer intValue : intList) {
    stringList.add(intValue.toString());
return stringList;
ListtoStringList(List l)
Turns given object list into a string list
List<String> l1 = new ArrayList<>();
l.forEach(object -> l1.add(object + ""));
return l1;
ListtoStringList(List as)
to String List
List<String> strings = makeList();
for (T a : as) {
    strings.add(a.toString());
return strings;
StringtoStringList(Map stringMap, String delim)
to String List
Iterator<Map.Entry<String, String>> iterator = stringMap.entrySet().iterator();
StringBuilder sb = new StringBuilder();
Map.Entry<String, String> entry = iterator.next();
sb.append(entry.getKey() + "=" + entry.getValue());
while (iterator.hasNext()) {
    entry = iterator.next();
    sb.append(delim + entry.getKey() + "=" + entry.getValue());
return sb.toString();
ListtoStringList(Scanner scanner, String toSplit, final char separator)
to String List
if (toSplit == null) {
    return Collections.emptyList();
final List<String> strings = new ArrayList<>();
int last = 0;
toSplit = toSplit.trim();
String currentValue = null;
boolean inEscape = false;
...
StringtoStringReplaceBrackets(List list)
to String Replace Brackets
return list.toString().replace('[', '(').replace(']', ')');
ListtoStringResult(List list)
to String Result
if (list == null || list.isEmpty()) {
    return null;
return list;