I have a string like this:
{"label":{"en":"Africa","de":"Afrika"},"description":{"en":"continent","de":"irdischer Kontinent"}}
Is possible convert to list like:
"label" - "en":"Africa","de":"Afrika"
"description" - "en":"continent","de":"irdischer Kontinent"
Thanks
As others have suggested, it looks like you're trying to process a JSON document. I recommend Json.NET for this.
However, you can manipulate your string by itself if the transformation is very simple and you don't expect much variation in your input. One easy way would be to do something like this:
var result = input.Replace(":{", " - ")
.Replace("},", Environment.NewLine)
.Replace("{", string.Empty)
.Replace("}", string.Empty);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With