-4

Following is the json element read from a text file and stored in a variable. i.e.

sCurrentLine = {
    "description": "Update gclient to handle when a DEPS file has no deps dictionary.\n\nCommitted: http://src.chromium.org/viewvc/chrome?view=rev&revision=1652",
    "cc": [],
    "reviewers": [
        "nils.juenemann@gmail.com"
    ],
    "owner_email": "sguireknight@gmail.com",
    "private": false,
    "base_url": "svn://chrome-svn.corp.google.com/chrome/trunk/depot_tools/",
    "owner": "sguireknight",
    "subject": "Handle when a DEPS file has no deps dictionary.",
    "created": "2008-09-02 20:11:04.145884",
    "patchsets": [
        1
    ],
    "modified": "2011-05-09 13:10:20.276741",
    "closed": true,
    "commit": false,
    "issue": 201
}

I want to access issue value 201. How can I do that?

user2436651
  • 23
  • 1
  • 1
  • 5
  • 2
    What programming language are you using? – qJake Jun 03 '13 at 17:28
  • Hi new user have you searched that or have you tried that? check http://stackoverflow.com/questions/383692/what-is-json-and-why-would-i-use-it?rq=1 – Sina R. Jun 03 '13 at 17:32

2 Answers2

1

If you're using Javascript (you didn't specify), you can just access the value by doing this:

sCurrentLine.issue

That's it.

qJake
  • 16,821
  • 17
  • 83
  • 135
0

Just for the sake of completeness there is another way access it in javascript

sCurrentLine["issue"]
Akshat Jiwan Sharma
  • 15,430
  • 13
  • 50
  • 60