Search code examples
iphonejsonparsingcomments

Any Method to remove comment characters from JSON response in Xcode?


I am new to JSON. Are there any methods in JSON parser to remove the comment characters from a response.

Eg. //{"response":"success".......

its SBJson for iPhone. from http://code.google.com/p/json-framework


Solution

  • The JSON grammar doesn't allow comments. That doesn't answer your question obviously, but I suspect you'll have to do some string manipulation and replace all those comment characters with empty strings and parse it with the JSON library only after doing so.