我尝试分割文本并将其放入字典中,问题是我的文本没有清晰的结构:文本:
{
"about": "where I'm meant to be...",
"bio": "Visit my official blog at:\n\nhttp://ABC.com/ \n\nAdd me on Twitter:\n\nhttp://www.ABC.com/ABC",
"category": "Public figure",
"is_published": true,
"location": {
"street": "",
"city": "Los Angeles",
"state": "CA",
"country": "United States",
"zip": ""
},
"talking_about_count": 254637,
"username": "ABC",
"website": "http://kimkardashian.celebuzz.com/\nhttp://www.twitter.com/kimkardashian\n",
"were_here_count": 0,
"id": "114696805612",
"name": "ABC",
"link": "http://www.ABC.com/ABC",
"likes": 0,
"cover": {
"cover_id": "000000000",
"source": "http://ABC.jpg",
"offset_y": 0,
"offset_x": 200
}
}
如您所见,我将“,”作为分隔符,问题是有一些组合对象,例如:
"location": {
"street": "",
"city": "Los Angeles",
"state": "CA",
"country": "United States",
"zip": ""
},
这就是为什么我不能使用string.Split(' ');
我听说过的正则表达式但我不知道如何使用它们是否有任何解决方案可以将这些信息分离到字典或任何其他结构中