0

kindly i want to convert this string to Json using javascript

 Result =    {"result":"{\"Response\":\"Success\"}"}

i firstly use

   Result=Result['result']

and i have this

   Result= '{"Response":"Success"}'

please your help to continue

Sereen
  • 39
  • 1
  • 3
  • 8
  • 3
    you can use JSON.parse – Vladu Ionut Sep 27 '16 at 06:30
  • For your information, `JSON` is already a `String` hence _"Convert String to JSON using Javascript"_ is wrong title.. `'{"Response":"Success"}'` is `JSON` hence `String`, to convert it as `Object`, Use `JSON.parse(YOUR_JSON)` – Rayon Sep 27 '16 at 06:31
  • Possible duplicate of [Safely turning a JSON string into an object](http://stackoverflow.com/questions/45015/safely-turning-a-json-string-into-an-object) – theduck Sep 27 '16 at 07:16

1 Answers1

2

You can use JSON.parse

The JSON.parse() method parses a string as JSON, optionally transforming the value produced by parsing.

 Result =    {"result":"{\"Response\":\"Success\"}"};
 Result = JSON.parse(Result['result'])
Vladu Ionut
  • 8,075
  • 1
  • 19
  • 30