Java Array to CSV ArrayToCsv(Object[] line)

Here you can find the source of ArrayToCsv(Object[] line)

Description

Array To Csv

License

Open Source License

Declaration

public static String ArrayToCsv(Object[] line) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    public static String ArrayToCsv(Object[] line) {
        StringBuilder csvLine = new StringBuilder();
        for (Object obj : line) {
            csvLine.append(obj.toString()).append(",");
        }// www  .  j a v a2s . co m

        csvLine.setCharAt(csvLine.length() - 1, '\n');

        return csvLine.toString();
    }
}

Related

  1. ArrayToCSV(String[] array)
  2. arrayToCsvString(String[] array, char delimiter)
  3. toCSV(double[] as)
  4. toCSV(int[][] values)