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 7039387
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T01:47:32+00:00 2026-05-28T01:47:32+00:00

My JsonArray is [{ Id: null, Name: One New task, StartDate: 2010-02-03T05:30:00, EndDate: 2010-02-04T05:30:00,

  • 0

My JsonArray is

[{
"Id": null,
"Name": "One New task",
"StartDate": "2010-02-03T05:30:00",
"EndDate": "2010-02-04T05:30:00",
"Duration": 1,
"DurationUnit": "d",
"PercentDone": 0,
"ManuallyScheduled": false,
"Priority": 1,
"parentId": 8,
"index": 0,
"depth": 3,
"checked": null },{
"Id": null,
"Name": "New task",
"StartDate": "2010-02-04T05:30:00",
"EndDate": "2010-02-04T05:30:00",
"Duration": 0,
"DurationUnit": "d",
"PercentDone": 0,
"ManuallyScheduled": false,
"Priority": 1,
"parentId": 8,
"index": 1,
"depth": 3,
"checked": null }]

Now from this JsonArray I want to remove Id, ManuallyScheduled, checked,

I tried using jsonArray.remove(1) and also jsonArray.discard("Id") in JAVA.
but nothing happens. what am I doing wrong to remove array items?

I am using JAVA as my technology.

  • 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-28T01:47:33+00:00Added an answer on May 28, 2026 at 1:47 am

    What you have there is an array of objects. Therefore you’ll have to loop through the array and remove the necessary data from each object, e.g.

    for (int i = 0, len = jsonArr.length(); i < len; i++) {
        JSONObject obj = jsonArr.getJSONObject(i);
        // Do your removals
        obj.remove("id");
        // etc.
    }
    

    I’ve assumed you’re using org.json.JSONObject and org.json.JSONArray here, but the principal remains the same whatever JSON processing library you’re using.

    If you wanted to convert something like [{"id":215},{"id":216}] to [215,216] you could so something like:

    JSONArray intArr = new JSONArray();
    for (int i = 0, len = objArr.length(); i < len; i++) {
        intArr.put(objArr.getJSONObject(i).getInt("id"));
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm creating a JsonArray such as: JsonArray jsonValues = new JsonArray(); for( int i
Hi I want to create a JSON array. I have tried using: JSONArray jArray
I have a JSON array like this: { forum:[ { id:1, created:2010-03-19 , updated:2010-03-19
I have this php code $jsonArray = array(); $sql = SELECT ID,CLIENT FROM PLD_SERVERS;
I have a piece of code that needs to handle both JSONObject and JSONArray
hey, i'm new to android and i'm trying to code an app which fetches
I'm new to Android development and I'm trying to code a little app which
i'm new to android development and i'm playing around with json data. I managed
Still working on this part of my script to parse my JSON jsonArray =
:::::::::: ObservableCollection :::::::::: ObservableCollection<Friend> Friends = new ObservableCollection<Friend> ( ); :::::::::: InitializeFriends :::::::::: private

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.