0

How can i sort a string from JsonText string to Sorted strings?

From

{
"A": "Command",
"B": [],
"C": "leaderboard.leaderboard",
"D": 3,
"E": "get_leaderboard_infos"
}

to

A : Command
D : 3
E : get_leaderboard_infos
2
  • Please clarify your question. Why C : leaderboard.leaderboard doesn't apperat in the output? Commented Jul 16, 2013 at 17:52
  • i want to remove unwanted result like C: Commented Jul 16, 2013 at 18:31

1 Answer 1

4

First use JSON.Net to parse the JSON text into objects. Once they are objects, you can sort or filter the objects in a list based on their values.

In order to "prune" the objects, meaning get rid of unwanted properties and values, simply create a different object that only has the properties you like, and copy the values from the JSON.Net output to your new objects, and then serialize your new objects into a new JSON string.

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

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.