Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Json Parsing....Need HELP URGENT PLEASE

Discussion in 'Scripting' started by sandipan4cse, Dec 11, 2015.

  1. sandipan4cse

    sandipan4cse

    Joined:
    Aug 25, 2013
    Posts:
    31
    Hiii @ll,
    I am getting a webservice respose from WWW class like

    {"ABC":"10.30 - 11.30","CDE":"10.30 - 02.35","EFG":"10.30 - 08.35"}

    How can i parse this json?
    like-
    ABC
    10.30 - 11.30
    CDE
    10.30 - 02.35
    EFG
    10.30 - 08.35

    Thanks in advance..... :)
     
  2. Diablo404

    Diablo404

    Joined:
    Mar 15, 2013
    Posts:
    136
  3. KelsoMRK

    KelsoMRK

    Joined:
    Jul 18, 2010
    Posts:
    5,539
    lordofduct and Diablo404 like this.
  4. sandipan4cse

    sandipan4cse

    Joined:
    Aug 25, 2013
    Posts:
    31
    Thanks. it was vary helpful.

    Is there any posibilities to get DateTime format from a string. Because I need to get difference between system time & json response time(Coming as a string) and to create a reverse timer.

     
  5. StarManta

    StarManta

    Joined:
    Oct 23, 2006
    Posts:
    8,744
    Google for "C# DateTime from string", there's plenty of sample code for that.
     
  6. KelsoMRK

    KelsoMRK

    Joined:
    Jul 18, 2010
    Posts:
    5,539
    Sure. If your destination type is a date then the serializer should just handle it for you. If not - as @StarManta mentioned - it's straightforward to convert.

    Off topic but writing URGENT HELP PLEASE in the subject won't make people respond faster :)