我有一个JSON
具有以下结构的文件:
{
"name":[
{
"someKey": "\n\n some Value "
},
{
"someKey": "another value "
}
],
"anotherName":[
{
"anArray": [
{
"key": " value\n\n",
"anotherKey": " value"
},
{
"key": " value\n",
"anotherKey": "value"
}
]
}
]
}
现在我想关闭文件strip
中每个值的所有空格和换行符。JSON
有没有办法遍历字典的每个元素以及嵌套的字典和列表?