So I'm working with umbraco and using the tag datatype. I'm trying to take all tags added to a given node and putting them into an array of strings but when I grab the value it always seems to come out like this:
"[\"Tag1\",\"Tag2\"]"
How can I convert this string of an array back into a regular array? All I have gotten so far was a string of individual characters
The array format you have provided as an example looks like part of the JSON object.
You could use JSON.net library to parse array token of the JSON object.
var array = JArray.Parse(tagString).Values<string>();
A complete example is available here.
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