Here you can find the source of concatenateList(List values)
Parameter | Description |
---|---|
values | List of header values. |
private static String concatenateList(List values)
//package com.java2s; //License from project: Open Source License import java.util.List; public class Main { /**/*from w w w. j ava2 s . co m*/ * Concatenates a bunch of header values, seperating them with a comma. * @param values List of header values. * @return String of all headers, with commas. */ private static String concatenateList(List values) { StringBuffer buf = new StringBuffer(); for (int i = 0, size = values.size(); i < size; ++i) { buf.append(((String) values.get(i)).replaceAll("\n", "").trim()); if (i != (size - 1)) { buf.append(","); } } return buf.toString(); } }