문제

Of the FCL classes (or even using an external API) is there a utility assembly, class or members that can be plugged into a .NET application to convert all named entities to their numeric equivalents?

For example, É would become É.

도움이 되었습니까?

해결책

You may take a look at the HtmlDecode and HtmlEncode methods:

class Program
{
    static void Main()
    {
        var s = HttpUtility.HtmlDecode("É");
        s = HttpUtility.HtmlEncode(s);
        Console.WriteLine(s); // prints É
    }
}
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top