namespace Vurdalakov
{
using System;
public static class StringExtensions
{
public static String EncodeHtml(this String s)
{
return s.Replace("&", "&").Replace("<", "<").Replace(">", ">").Replace("\"", """).Replace("'", "'");
}
public static String DecodeHtml(this String s)
{
return s.Replace("&", "&").Replace("<", "<").Replace(">", ">").Replace(""", "\"").Replace("'", "'");
}
}
}
Tuesday, October 3, 2017
[C#] Encode and decode HTML strings
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment