【发布时间】:2016-04-06 06:26:28
【问题描述】:
我有一个字符串如下
[["3254","CCH"],["001","Sulmatyl 50mg","Sulpiride",[0,0,0,0,1],28,0.5],["002","Knowful 1.2g","Piracetam",[1,0,0,0,0],28,1],["003",Tranexamic acid 250mg","Tranexamic acid",[0,3,3,3,0],7,1],["004","Isormol 20mg","Isosorbide mononitrate",[0,3,0,3,0],28,0.5],["005","Plavix 75mg","Clopidogrel",[1,0,0,0,0],28,1]]
如何将此字符串转换为数组? 所以它会像
[
["3254","CCH"], // pres[0]
["001","Sulmatyl 50mg","Sulpiride",[0,0,0,0,1],28,0.5], //pres[1]
["002","Knowful 1.2g","Piracetam",[1,0,0,0,0],28,1], //pres[2]
["003",Tranexamic acid 250mg","Tranexamic acid",[0,3,3,3,0],7,1], //pres[3]
["004","Isormol 20mg","Isosorbide mononitrate",[0,3,0,3,0],28,0.5], //pres[4]
["005","Plavix 75mg","Clopidogrel",[1,0,0,0,0],28,1] //pres[5]
]
【问题讨论】:
-
举例说明你想要哪种类型的数组。这将帮助其他人解决您的问题。
-
刚刚编辑过!!谢谢!
-
告诉我你是怎么得到这个字符串的?来自 json 响应或任何其他方式。
-
似乎字符串在["003",Tranexamic...处漏掉了一个字符'"'
-
必须是["003","Tranexamic...,如果是JSON的话