/// <summary> /// Gets value as unescaped string. /// </summary> public string GetString() { if (Type != JsonValueType.String) { throw new InvalidOperationException($"The type of this value not a string: '{Type}'"); } return(JsonFormatUtility.Unescape(Raw)); }
public void Unescape() { string result0 = JsonFormatUtility.Unescape(m_escaped); string result1 = JsonFormatUtility.Unescape("http:\\/\\/placehold.it\\/32x32"); string result2 = JsonFormatUtility.Unescape(m_escaped2); Assert.AreEqual(m_unescaped, result0); Assert.AreEqual("http://placehold.it/32x32", result1); Assert.AreEqual(m_unescaped, result2); }