0

I am receiving this response from my sever but am unsure how to parse it out to and easy string to quantify.

What I am receiving "["yes"]"

What I want @"yes"

I am sure it is simple im just tired

Raymond
  • 477
  • 2
  • 5
  • 15
  • 1
    if you're tired, it might be worthwhile to just take a nap and come back to this fresh tomorrow... – Michael Dautermann Nov 12 '12 at 00:02
  • And when you come back to this tomorrow, perhaps you can more clearly describe the nature of the server response. "["yes"]" doesn't make sense. Do you mean a five character string "[yes]"? Or are you getting quotation marks in the response, too? I'm not clear what you're trying to say. – Rob Nov 12 '12 at 00:07

1 Answers1

1
NSString *stringToCheck = @"['Yes']";
NSString *value = [foo substringWithRange:NSMakeRange(2, [foo length] - 2 * 2)];

Sources that is good for you to check:

  1. how-to-get-substring-of-nsstring

  2. search-within-nsstring

Community
  • 1
  • 1
Vlad Z.
  • 3,401
  • 3
  • 32
  • 60