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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T16:39:57+00:00 2026-06-10T16:39:57+00:00

hi i have this string { data: [ { name: Lorena Trujillo, id: 500144123

  • 0

hi i have this string { “data”: [ { “name”: “Lorena Trujillo”, “id”: “500144123” }, { “name”: “George Arcila”, “id”: “520311359” }, { “name”: “Laura Victoria Mu\u00f1oz Rincon”, “id”: “528543677” }, { “name”: “Camilo Andres Santacoloma Mejia”, “id”: “529547832” }],”paging”: { “next”: “https://graph.facebook.com/537223119/friends?access_token=AAAAAAITEghMBAI7cZBdbAHt3ZC24esi4ZA6O6kFdwU1H0ekDmGQGRZCUZAVW3T6W6fzg50jHsdfsdfsfdsfdsfzdixf1RrTFLzV96ZBWXAZDZD&limit=5000&offset=5000&__after_id=1000456456455” }

}

and y need extract the substring between [ and ] i use the next code

NSRange startRange = [strFriends rangeOfString:@"["];
NSRange endRange = [strFriends rangeOfString:@"]"];
NSString *formData = [strFriends  substringWithRange:NSMakeRange(startRange.location,endRange.location)];
NSLog(@"this is the data %@",formData); 

and the result is

[ { “name”: “Lorena Trujillo”, “id”: “500144123” }, { “name”: “George Arcila”, “id”: “520311359” }, { “name”: “Laura Victoria Mu\u00f1oz Rincon”, “id”: “528543677” }, { “name”: “Camilo Andres Santacoloma Mejia”, “id”: “529547832” }],”pagin

any idea why these last characters appear ,”pagin thank you very much

  • 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-10T16:39:58+00:00Added an answer on June 10, 2026 at 4:39 pm

    This is because startRange location and endRange location both point to the location within the string – but subStringWithRange takes a location and a length – so you need to calculate the length of the string you want to extract. Like this:

    NSUInteger dataLength = endrange.location - startRange.location;
    NSString *formData = [strFriends  substringWithRange:NSMakeRange(startRange.location,dataLength)];
    

    Besides that, you really need a JSON parser for parsing JSON. Picking out small substrings like this is going to be a lot of work and brittle.

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

Sidebar

Related Questions

I have a list of this class: public class Data { public string name
I have this connection string <add name=ApplicationServices connectionString=Data Source=local;Initial Catalog=mycatalog;Integrated Security=True providerName=System.Data.SqlClient/> The problem
Lets say I have this code: public void MyMethod(string Data, List<string> InputData) { //I
I have this class: public MyClass { public void initialize(Collection<String> data) { this.data =
I have a need to build the data string dynamically. This is not working,
I have a string like this: TEST.DATA.Data.COR.Point,2;TEST.DATA.Data.COR.Point,5;TEST.DATA.Data.COR.Point,12;TEST.DATA.Data.COR.Point,12;TEST.DATA.Data.COR.WordTOFIND,18 I have a list of array with
I have a timedate string in a round-trip data pattern like this: 2012-07-05T11:30:44.1533815Z .
I am getting JSON string from website. I have data which looks like this
I have XML like this: <exam> <section name=SampleSection1> <attributes> <variable_name data_type=String value=SCORE/> </attributes> <item
i have an string data array which contains data like this 5~kiran 2~ram 1~arun

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.