Here you can find the source of csvstring(Object[] str)
Parameter | Description |
---|---|
str | a parameter |
public static String csvstring(Object[] str)
//package com.java2s; //License from project: Open Source License public class Main { /**// w w w . j a v a 2 s . c o m * Create a CSV string from an array of objects. This does NOT enclose strings * or espace any special characters, it only joins the elements with a comma. * @param str * @return */ public static String csvstring(Object[] str) { if (str.length > 0) { StringBuilder csvBuilder = new StringBuilder(); for (Object n : str) { csvBuilder.append(n.toString()).append(","); } csvBuilder.deleteCharAt(csvBuilder.length() - 1); return csvBuilder.toString(); } else { return ""; } } }