Latest version of Microsoft Asp.Net Core 1.0 provide Html encode and decode feature using following Namespace and class.
As we know now Microsoft Asp.Net Core is open source so we can see the actual code of system level classes which was not possible earlier.
All source code avalaible in GitHub on aspnet repository.
HtmEncode and HtmlDecode is now part of System.Runtime.Extensions.
As we know now Microsoft Asp.Net Core is open source so we can see the actual code of system level classes which was not possible earlier.
All source code avalaible in GitHub on aspnet repository.
HtmEncode and HtmlDecode is now part of System.Runtime.Extensions.
namespace System.Net { public static partial class WebUtility { public static string HtmlDecode(string value) { return default(string); } public static string HtmlEncode(string value) { return default(string); } public static string UrlDecode(string encodedValue) { return default(string); } public static byte[] UrlDecodeToBytes(byte[] encodedValue, int offset, int count) { return default(byte[]); } public static string UrlEncode(string value) { return default(string); } public static byte[] UrlEncodeToBytes(byte[] value, int offset, int count) { return default(byte[]); } } }How to use HtmlEncode and HtmlDecode static property.
var dummyString = "Dummy%20String"; var decodeString = System.Net.WebUtility.HtmlDecode(dummyString );That’s it. Hope you like it. Stay tuned for more!!
0 comments:
Post a Comment