write json string in C# with variable code example Example: string to json c# JObject json = JObject.Parse(str);