Here you can find the source of convertStringArrayToString(String[] a_asStrings, String a_sDelim)
Parameter | Description |
---|---|
String | a_sDelim - the string delimiter to use |
public static String convertStringArrayToString(String[] a_asStrings, String a_sDelim)
//package com.java2s; public class Main { /**/*from ww w.ja v a 2s . com*/ * Takes an array of Strings and turns them in to a comma delimited list of * strings in a string. * * @param String[] a_asStrings - the array of strings to make the string from * @param String a_sDelim - the string delimiter to use * @return String[] - the string containing the list of strings * */ public static String convertStringArrayToString(String[] a_asStrings, String a_sDelim) /* ------------------------------------------------------------------------ d1 20-Oct-2003 Chris Preager Created from Img Mangr ------------------------------------------------------------------------ */ { StringBuffer sb = new StringBuffer(""); if ((a_asStrings != null) && (a_asStrings.length > 0)) { sb.append(a_asStrings[0]); if (a_asStrings.length > 1) { for (int i = 1; i < a_asStrings.length; i++) { sb.append(a_sDelim + a_asStrings[i]); } } } return (sb.toString()); } }