Here you can find the source of concatCollection(Collection
Parameter | Description |
---|---|
collection | The collection you want to get the String from |
public static String concatCollection(Collection<String> collection)
//package com.java2s; //License from project: Open Source License import java.util.Collection; public class Main { /**/*from w w w. jav a 2 s . c o m*/ * Converts a collection of Strings into one long String. * @param collection The collection you want to get the String from * @return The String generated from the collection */ public static String concatCollection(Collection<String> collection) { StringBuilder sb = new StringBuilder(collection.size()); for (String s : collection) { sb.append(String.valueOf(s)); } return sb.toString(); } }