[英]Actionscript/Flex string to array
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. 我尝试将HTTPService结果类型设置为array / arraycollection,这不起作用。 The only thing I can think is to do some sort of string split/join.
我唯一能想到的就是执行某种字符串拆分/连接。
That looks like JSON to me; 在我看来,这就像JSON; so I would look into using the Flash Player's native JSON classes.
因此我将研究使用Flash Player的本机JSON类。
If you really want to use String parsing; 如果您真的想使用字符串解析; then I'd look into the split() function;
然后我看一下split()函数; which will turn it into an Array.
它将变成一个数组。 But, it seems like you'd be stuck doing string parsing to get every value.
但是,似乎您会被困在进行字符串解析以获取所有值。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.