There is a class for deserializing json strings
public class RootObject { public string id { get; set; } public string display_advertiser { get; set; } public object advertiser_id { get; set; } } In the program code, I deserialize the input json string into it
List<RootObject> root = new List<RootObject>(); var item = new JavaScriptSerializer().Deserialize<RootObject>(str); root.Add(item) Now I want to run through the root elements and combine the data of each instance into a string with a separator ;
for (int i = 0; i < root.Count; i++) { var data = string.Join(";",... а что писать тут?); } In general, it is not entirely clear how to convert an element of an array to a string.
ToStringmethod on theRootObjectclass - Grundy