Serialize a Collection |
This sample serializes a collection to JSON.
List<string> videogames = new List<string> { "Starcraft", "Halo", "Legend of Zelda" }; string json = JsonConvert.SerializeObject(videogames); Console.WriteLine(json); // ["Starcraft","Halo","Legend of Zelda"]