Here you can find the source of listToString(List
Parameter | Description |
---|---|
queryList | the query list |
delimitedString | the delimited string |
public static String listToString(List<String> queryList, String delimitedString)
//package com.java2s; /*/*from www . j a v a2 s . c o m*/ * StringUtil.java * Copyright (c) 2013, EcoFactor, All Rights Reserved. * * This software is the confidential and proprietary information of EcoFactor * ("Confidential Information"). You shall not disclose such Confidential Information and shall use * it only in accordance with the terms of the license agreement you entered into with * EcoFactor. */ import java.util.Iterator; import java.util.List; public class Main { /** * List to string. * @param queryList the query list * @param delimitedString the delimited string * @return the string */ public static String listToString(List<String> queryList, String delimitedString) { String newString = ""; for (Iterator<String> it = queryList.iterator(); it.hasNext();) { newString += it.next(); if (it.hasNext()) { newString += delimitedString; } } return newString; } }