/// <summary> /// HTML-encodes a string and sends the resulting output to a TextWriter output stream. /// </summary> /// <param name="s">The string to encode. </param> /// <param name="output">The TextWriter output stream containing the encoded string. </param> public static void HtmlEncode(string s, TextWriter output) { if (output == null) { throw new NullReferenceException(".NET emulation"); } if (!string.IsNullOrEmpty(s)) { output.Write(HttpEncoder.HtmlEncode(s)); } }
public static string HtmlEncode(string s) { return(HttpEncoder.HtmlEncode(s)); }