string x = "&Microsoft<?xml version=";
string y = System.Web.HttpUtility.HtmlDecode(x);
Console.WriteLine(y);
Console.ReadLine();
Now the y value is &Microsoft<?xml version=
In this case the web.httputility.htmldecode not working
I am expecting result is &Microsoft<?xml version=
Please reply if there is answer for this.
The code looks good. Upon testing it on my local. I got what your expected result.
UPDATE
For .Net Core, it still the same code but rather remove the unnecessary '&' on the first character of the string. Because it is forbidden to use ampersand without any related url encoding version
You can check the code behind for .net core implementation of HtmlEncoder.cs
I hope it helps. Happy coding.