字典支持动态添加key-value吗
bigsquirrel opened this issue · comments
ivanchou commented
我想读取json后在代码重将其解析成key-value的结构,发现并不能做到。
比如json中,
"user":[{"name":"xiaoming", "age":18},{"name":"xiaohong", "age":20}]
想在代码中转成
"xiaoming":18
"xiaohong":20
的结构。
发现没法做到。
ivanchou commented
append 只支持数组
(:) 字典只能在定义的时候进行初始化,后续没办法去 append
Mars Liu commented
这部分确实没做测试,我想了想过去的代码里没用到这种功能,回去我测一下,确认一下做法然后刚到gisp2里
获取 Outlook for iOS<https://aka.ms/o0ukef>
…________________________________
发件人: ivanchou <notifications@github.com>
发送时间: Saturday, April 20, 2019 7:21:17 PM
收件人: Dwarfartisan/gisp
抄送: Subscribed
主题: Re: [Dwarfartisan/gisp] 字典支持动态添加key-value吗 (#12)
append 只支持数组
(:) 字典只能在定义的时候进行初始化,后续没办法去 append
―
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub<https://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FDwarfartisan%2Fgisp%2Fissues%2F12%23issuecomment-485096155&data=02%7C01%7C%7Cf195ac3307c64783f48308d6c5824f0d%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636913560792675914&sdata=PgSRuo8E9YRJp4yspDY0Ay7oykBbdtQHxHDR0uHq1O0%3D&reserved=0>, or mute the thread<https://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAAFN2MZ3MVE7HIJQ3ZOR2WTPRL4C3ANCNFSM4HHJPNHA&data=02%7C01%7C%7Cf195ac3307c64783f48308d6c5824f0d%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636913560792685924&sdata=RseDGUqtjOBXlIQb%2F%2BBEh%2B3aYIhbiUPb0FNdlAlCkdM%3D&reserved=0>.