String with strange format to array

c#

Solution

What you have is JSON array. You can simply deserialize it with JSON.NET (you can add it from NuGet):

string s = "[\"default\",\"direct\"]";
string[] result = JsonConvert.DeserializeObject<string[]>(s);

Problem

I have this string: ``` string s = "[\"default\",\"direct\"]"; ``` I want to make an array, so the final array should be this: ``` ["default", "direct"] ``` What I have tried: ``` string[] ss = s.Split(','); ``` But the result is:

Original source