ファイルがありalmost-json
ます。EST(東部基準時。1000 行。その一部を次に示します。
level: {
1: {
cost: 200,
hp: 300,
townhall: { required: 2, max: 0 }
},
2: {
cost: 1000,
hp: 500,
townhall: { required: 2, max: 25 }
},
}
すべてのコードはほぼこのようなものです。何百ものネストされたオブジェクト。このファイルdouble quotes
のすべてkeys
(文字列のみ)に追加したいと思います。これは、コロンで終わるすべての文字列を意味します。このような:
"level": {
1: {
"cost": 200,
"hp": 300,
"townhall": { "required": 2, "max": 0 }
},
2: {
"cost": 1000,
"hp": 500,
"townhall": { "required": 2, "max": 25 }
},
}
同様の質問をいくつか見ましたが、探しているものではありませんでした。