Created
September 29, 2011 12:48
-
-
Save thiagotn/1250662 to your computer and use it in GitHub Desktop.
Write Csv Content
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class WriteCsv { | |
public static String writeCsvContent(String[][] data) { | |
StringBuilder csv = new StringBuilder(); | |
String delimiter = ","; | |
String breakLine = "\n"; | |
for (int line = 0; line < data.length; line++) { | |
for (int column = 0; column < data[line].length; column++) { | |
csv.append(data[line][column]); | |
if (column < data[line].length-1) csv.append(delimiter); | |
} | |
csv.append(breakLine); | |
} | |
return csv.toString(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment