Suppose I have an array of int, float, string etc. Is there any utility API (e.g. Commons, Guava) that will give me a comma separated string?
Like so,
int[] a = {1,2,3,4,5}.
String s = magicAPI.getCSV(a); // s == "1,2,3,4,5";
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I’ve used OpenCSV in the past.
However, for such a trivial example you might want to just use the a
StringBuilderand aforloop