Here you can find the source of arrayStringtoString(final String[] arrayString)
Parameter | Description |
---|---|
arrayString | Array of string to concat |
public static String arrayStringtoString(final String[] arrayString)
//package com.java2s; /*/*from w ww . ja v a 2s. c om*/ * Nividic development code * * This code may be freely distributed and modified under the * terms of the GNU Lesser General Public Licence. This should * be distributed with the code. If you do not have a copy, * see: * * http://www.gnu.org/copyleft/lesser.html * * Copyright for this code is held jointly by the microarray platform * of the ?cole Normale Sup?rieure and the individual authors. * These should be listed in @author doc comments. * * For more information on the Nividic project and its aims, * or to join the Nividic mailing list, visit the home page * at: * * http://www.transcriptome.ens.fr/nividic * */ public class Main { /** * Create a String object with all element of an array of String separated by * double quotes and commas. * @param arrayString Array of string to concat * @return a concatened String */ public static String arrayStringtoString(final String[] arrayString) { StringBuffer sb = new StringBuffer(); if (arrayString != null) { for (int i = 0; i < arrayString.length; i++) { if (i > 0) sb.append(","); sb.append('\"'); sb.append(arrayString[i]); sb.append('\"'); } } return sb.toString(); } }