3

Using JSON.Stringify I pass the following string inside another Stringify object.

[
    [
        "I-000-4310-000",
        "Convention Registration",
        "59.99"
    ],
    [
        "I-000-4311-000",
        "Convention Breakout",
        "39.99"
    ]
]

In my C# web service I need to split the string apart into a string array that looks like this:

 string[, ,] GLCodes = new string[,,] 
 { 
    {
        { "I-000-4310-000", "Convention Registration", "59.99" }, 
        { "I-000-4311-000", "Convention Breakout", "9.99" }
    } 
 };

What is the simplest way to do this?

3
  • Connie take a look at this site and see if it helps stackoverflow.com/questions/9586585/… Commented Feb 9, 2013 at 23:27
  • do you use JSON JavaScriptSerializer look here for an example JavaScriptSerializer Commented Feb 9, 2013 at 23:30
  • 1
    I recommend Json.NET. Read up about it (or the alternatives), then get back when there is a problem with some actual code :D As of right now, this is "not a real question" (or, not more of a question than that which can be succinctly answered in a comment without writing the code for you). Commented Feb 9, 2013 at 23:33

1 Answer 1

7

Using Json.NET you can deserialize that list with this

string[][] strings = JsonConvert.DeserializeObject<string[][]>(jsonData);

Hope this helps!

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.