Java List Combine combineLines(List lines)

Here you can find the source of combineLines(List lines)

Description

combine Lines

License

Open Source License

Declaration

public static String combineLines(List<String> lines) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.util.List;

public class Main {
    public static String combineLines(List<String> lines) {
        StringBuilder sb = new StringBuilder();
        boolean firstLine = true;
        for (String line : lines) {
            if (firstLine) {
                sb.append("\n");
                firstLine = false;/*from  w  w w.  j  a  va  2s.c  om*/
            }
            sb.append(line);
        }
        return sb.toString();
    }
}

Related

  1. combineArray(List> data)
  2. combineArray(List... p)
  3. combineAsLists(Object one, Object two)
  4. combineAux(List> collections, List objectAccumulator, List> resultList)
  5. combineFloat(List nums)
  6. combineList(List l1, List l2)
  7. combineLists(List keys, List values)
  8. combineLists(List a, List b)
  9. combineString(List lstInput, String strToken)