public override void WritePropertyName(string name) { base.WritePropertyName(name); JavaScriptUtil.WriteEscapedJavaScriptString(fWriter, name, fQuoteChar, QuoteName); fWriter.Write(':'); }
public override void WriteValue(string value) { base.WriteValue(value); if (value == null) { WriteValueInternal(JsonConvert.Null, JsonToken.Null); } else { JavaScriptUtil.WriteEscapedJavaScriptString(fWriter, value, fQuoteChar, true); } }
/// <summary> /// Converts the <see cref="String"/> to its JSON string representation. /// </summary> /// <param name="value">The value to convert.</param> /// <param name="delimter">The string delimiter character.</param> /// <returns>A JSON string representation of the <see cref="String"/>.</returns> public static string ToString(string value, char delimter) { return(JavaScriptUtil.ToEscapedJavaScriptString(value, delimter, true)); }