https://stackoverflow.com/questions/22306430

CSharp · Console

/Program.cs

using System;
using System.Linq;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
					
public class Program
{
	public static void Main()
	{
		string json = @"
		[
			{
				""col1"": ""foo"",
				""col2"": ""bar""
			},
			{
				""col1"": ""baz"",
				""col2"": ""quux""
			},
			{
				""col1"": ""fizz"",
				""col2"": ""bang""
			}
		]";
		
		JArray array = JArray.Parse(json);
		
		JArray sorted = new JArray(array.OrderBy(obj => (string)obj["col2"]));
		
		Console.WriteLine(sorted.ToString(Formatting.Indented));
	}
}
;