Loading ...
Sorry, an error occurred while loading the content.

1395Re: [json] Re: Convert String - JSON

Expand Messages
  • Diego Roberto
    Sep 17, 2009
      Thank you for your attention.
      Reading the documentation could utilizare "eval" that solved my problem.

      Thank you.

      2009/9/17 Fredag_d13 <jonas@...>

      > --- In json@yahoogroups.com <json%40yahoogroups.com>, "rubao"
      > <diegorrborges@...> wrote:
      > >
      > >
      > > Hi, I am developing an application with GIS and a hand me the server
      > returns a string containing a JSON object. I need to go through this object
      > to separate the fields, what happens is that he came in the form of String.
      > How can you convert this String in JSON, I tried this way and it did not
      > work:
      > >
      > > # JSONArray ja = new JSONArray (objetos.toString ()); / / objects is my
      > json array
      > >
      > If your server string contains a json-object then parse it to an object, if
      > its a json-array then parse it into an array. Pick a JSON-implementation at
      > www.json.org to do the work. If the implementation does not allow
      > json-arrays to be parsed directly, then wrap the array into a dummy object,
      > ie.: "{ \"dummy\": "+server_string+"}"

      Diego Roberto
      (62) 9619-0902
      "Corra atrás dos seus sonhos... Eles são a única coisa que te acompanham até
      quando vc está dormindo!!!"


      [Non-text portions of this message have been removed]
    • Show all 3 messages in this topic