Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

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.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8263323
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T04:03:47+00:00 2026-06-08T04:03:47+00:00

Suppose I have an array of int, float, string etc. Is there any utility

  • 0

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";
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T04:03:48+00:00Added an answer on June 8, 2026 at 4:03 am

    I’ve used OpenCSV in the past.

    StringWriter stringWriter = new StringWriter();
    int[] a = {1,2,3,4,5};
    String[] b = new String[a.length];
    for ( int i = 0; i < a.length; i++) {
        b[i] = a[i];
    }
    CSVWriter csvWriter = new CSVWriter(stringWriter, ",");
    csvWriter.writeNext(b);
    

    However, for such a trivial example you might want to just use the a StringBuilder and a for loop

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Suppose that I have a 2D array (matrix) in Java like this... int[][] MyMat
suppose that we have three array int a[]=new int[]{4,6,8,9,11,12}; int b[]=new int[]{3,5,7,13,14}; int c[]=new
Suppose I have an array or any other collection for that matter in class
Suppose that I have the following c function: int MyFunction( const float arr[] )
Suppose I have an int-array and I want to modify it. I know that
Suppose we have an array say: int arr[1000]; and I have a function that
Suppose an int[] is passed in, and I have function f(int[] array), if I
Suppose I have an array that mimics a database table. Each array element represents
I have a question about Quantifiers. Suppose that I have an array and I
Suppose I have a sorted array of integers int[] , and I want to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.