views:

60

answers:

0

I expected the following code

JsonArray.Parse("[\"cat\",\"dog\"]")[0].ToString()

to give me cat but it actually gives me "cat".

Is this a bug or by design.

Interestingly there is a private value member which does give cat.

 (((System.Json.JsonPrimitive)(JsonArray.Parse("[\"cat\",\"dog\"]")[0]))).value

will give cat - but its private !

(JsonArray is in System.Json.dll which for Silverlight 4 is here : C:\Program Files\Microsoft SDKs\Silverlight\v4.0\Libraries\Client\System.Json.dll)