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

  • SEARCH
  • Home
  • 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 6934251
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T11:56:09+00:00 2026-05-27T11:56:09+00:00

I have created an array list from a database column and I want to

  • 0

I have created an array list from a database column and I want to strip out the square brackets and display each element in a new line or spaced out. I’m using string builder to try and do this, the issue with this code is that it adds all the elements together in the string. Can anyone help me with this?

Here is my code :

Cursor cursor2 = data.IngredientfetchRows(ID);
startManagingCursor(cursor2);
//cursor2.moveToFirst();

ArrayList<String> al = new ArrayList<String>();
cursor2.moveToFirst();
while(!cursor2.isAfterLast()) {
    //  Log.d("", "" + cursor.getString(cursor
    //                  .getColumnIndex(ProfileDbAdapter.KEY_PROFILE_NAME)));
    String mIngredientName = cursor2.getString(1);
    al.add(mIngredientName);
    cursor2.moveToNext();
}

StringBuilder builder = new StringBuilder();
for (String value : al) {
    builder.append(value);
}
String text = builder.toString();

Speech.setText(text);

data.close();
// + " " + cursor.getString(2) + "" + cursor.getString(3)
initSpeak();
speakButtons(StartSpeech);
  • 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-05-27T11:56:10+00:00Added an answer on May 27, 2026 at 11:56 am

    If you don’t mind the newline at the end of the list:

    StringBuilder builder = new StringBuilder();
    for (String value : al) {
        builder.append(value).append('\n');
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have already created a report using list of data from my database. i
I have an array I've created in JavaScript. The end result comes out to
i have created a simple database for inserting the list of data into my
I have created a class, it store the data from mySQL database into class.
i have created Array of Linkbutton and when user click on link button it
I have created an array Man: public main blah blah{ man = man[10]; }
I have an array created with this code: var widthRange = new Array(); widthRange[46]
How do I pass an array I have created on the server side onto
Explanation I have a multidimensional array that is iterated over to created a categorized
I have a JSON array like this: { forum:[ { id:1, created:2010-03-19 , updated:2010-03-19

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.