【发布时间】:2016-07-25 15:08:05
【问题描述】:
JsonString.txt
{ "profile": { "name": { "formatted": "John Jackson", "givenName": "John", "familyName": "Jackson" }, "verifiedEmail": "rpxstaging@gmail.com ","googleUserId":"1048morenumbers2048","displayName":"John Jackson","photo":"","preferredUsername":"rpxstaging","url":"","providerName":"Google",标识符“:”,“生日”:“1994-05-19”,“性别”:“女性”,“电子邮件”:“rpxstaging@gmail.com”},“accessCredentials”:{“oauthToken”:“1 /V2UImanylettersandnumbersrnWlVS7c", "oauthTokenSecret":"i5rlettersQU-32moreVY", "scopes": "Blogger,Google Contacts,YouTube,Picasa Web,相册,Google Calendar,Google Docs,Google Mail,Google OpenSocial", "scope":"" , "type":"OAuth" }, "merged_poco": { "name": { "formatted": "John Jackson", "givenName": "John", "familyName": "Jackson" }, "addresses": [ { "country": "United States" } ], "photos": [ { "type": "other", "value": " " } ], "urls": [ { "type": "profile", “价值”:“”}],“首选用户名”:“rpxstaging”,“电子邮件”:[{“类型”:“其他”,“价值”:“r pxstaging@gmail.com" } ], "languagesSpoken": [ "en-US" ], "id":"1048numbers2048", "displayName": "John Jackson", "profileUrl": " " }, "stat": “好的”}
- 我需要将上面的 jsonString 转换为如下所示的字符串
String.txt
{ \"profile\": { \"name\": { \"formatted\": \"John Jackson\", \"givenName\": \"John\", \"familyName\": \ "Jackson\" }, \"verifiedEmail\": \"rpxstaging@gmail.com\", \"googleUserId\": \"1048morenumbers2048\", \"displayName\": \"John Jackson\", \"照片\": \" \" , \"preferredUsername\": \"rpxstaging\", \"url\": \" \", \"providerName\": \"Google\", \"identifier\": \ “\”,\“生日\”:\“1994-05-19\”,\“性别\”:\“女性\”,\“电子邮件\”:\“rpxstaging@gmail.com\”},\ "accessCredentials\":{ \"oauthToken\":\"1/V2UImanylettersandnumbersrnWlVS7c\", \"oauthTokenSecret\": \"i5rlettersQU-32moreVY\", \"scopes\": \"Blogger,Google 通讯录,YouTube,Picasa网络相册、Google 日历、Google 文档、Google Mail、Google OpenSocial\" 、\"scope\": \"\"、\"type\": \"OAuth\" }、\"merged_poco\": { \" name\": { \"formatted\": \"John Jackson\", \"givenName\": \"John\", \"familyName\": \"Jackson\" }, \"addresses\": [ { \"country\": \"United States\" } ], \"photos\": [ { \"type\": \"other\", \"value\": \" " } ], \"urls\": [ { \"type\": \"profile\", \"value\": \" \" } ], \"preferredUsername\": \"rpxstaging\" , \"emails\": [ { \"type\": \"other\", \"value\": \"rpxstaging@gmail.com\" } ], \"languagesSpoken\": [ \"en- US\" ], \"id\": \"1048numbers2048\", \"displayName\": \"John Jackson\", \"profileUrl\": \" \" }, \"stat\": \"好的\" }
- 谁能告诉我如何转换?我是这个 JSON 的新手
【问题讨论】: