0

I'm working with a 3rd party web service and it's returning a string like the below. I'm completely stuck on how to parse this into a usable format. It appears it's an array, just in text format.

[["theData",{"something":somevalue,"details":null,"somethingElse":"something"},0]]

It could also have multiple, like

[["theData",{"something":somevalue,"details":null,"somethingElse":"something"},0],["theData",{"something":somevalue,"details":null,"somethingElse":"something"},0]]

I've tried setting the HTTPService result type as array/arraycollection, that doesn't work. The only thing I can think is to do some sort of string split/join.

1 Answer 1

1

That looks like JSON to me; so I would look into using the Flash Player's native JSON classes.

If you really want to use String parsing; then I'd look into the split() function; which will turn it into an Array. But, it seems like you'd be stuck doing string parsing to get every value.

Sign up to request clarification or add additional context in comments.

3 Comments

Yes, JSON is the {} part, which is part of the array.
You were correct. It was JSON. (facepalm). I'm so used to an array of json starting/ending with {}
@beta4 No need to facepalm. Four months ago I wouldn't have recolonized it at all.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.