Here you can find the source of listToString(List inList, String delimeter)
Parameter | Description |
---|---|
inList | a parameter |
delimeter | a parameter |
public static String listToString(List inList, String delimeter)
//package com.java2s; /**//from w w w . ja v a 2 s .c o m * Copyright (c) 2015 SK holdings Co., Ltd. All rights reserved. * This software is the confidential and proprietary information of SK holdings. * 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 SK holdings. * (http://www.eclipse.org/legal/epl-v10.html) */ import java.util.Iterator; import java.util.List; public class Main { /** * listToString * * @param inList * @param delimeter * @return String */ public static String listToString(List inList, String delimeter) { if (inList == null) return null; StringBuffer stBuf = new StringBuffer(); for (Iterator itr = inList.iterator(); itr.hasNext();) { if (stBuf.length() > 0) { stBuf.append(delimeter); } stBuf.append((itr.next()).toString()); } return stBuf.toString(); } }