在FCL类(甚至使用外部API)中,是否存在可以插入.NET应用程序中的实用程序集合,类或成员,以将所有命名实体转换为其数字等效物?

例如, É 会成为 É.

有帮助吗?

解决方案

您可以看一下 htmldecodehtmlencode 方法:

class Program
{
    static void Main()
    {
        var s = HttpUtility.HtmlDecode("É");
        s = HttpUtility.HtmlEncode(s);
        Console.WriteLine(s); // prints É
    }
}
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top