-
Notifications
You must be signed in to change notification settings - Fork 299
Description
When doing node["somekey"].ToString() on a JSONNode where the value is already a string, the string is returned wrapped into double quotes, so .ToString() currently returns a literal "abc" instead of an expected abc string.
That happens in WriteToStringBuilder() of class JSONString, that explicitly does
aSB.Append('\"').Append(Escape(m_Data)).Append('\"');
Is there a rationale for this? I was using .ToString() as an easy way to make sure to get a string representation, no matter what the actualy type may have been. However, the unexpected quotes lead to errors e.g. in comparing with expected values, or further parsing the string, so I find myself .Trim()ing them away.
Actual behaviour: string values are returned wrapped in quotes.
Expected behaviour: the string should be returned without quotes.
Thanks for considering.