HTML特殊转义字符列表
最常用的字符实体
Character Entities
显示 说明 实体名称 实体编号
半方大的空白    
全方大的空白    
不断行的空白格  
< 小于 < <
> 大于 > >
& &符号 & &
" 双引号 " "
? 版权 © ©
? 已注册商标 ® ®
? 商标(美国) ? ™
× 乘号 × ×
÷ 除号 ÷ ÷
/// <summary>
/// Replaces the < with the less then symbol and > with the greater then symbol.
/// </summary>
/// <param name="xml">String to be unescaped</param>
/// <returns>An xml string containing the greter then and less then symbols.</returns>
private string UnEscapeXml(string xml)
{
string result = xml.Replace("<", "<");
result = result.Replace(">", ">");
result = result.Replace("'<'", "<");
result = result.Replace("'quot'", """);
return result.Replace("'>'", ">");
}
/// <summary>
/// Replaces the less then and greater then symbol with < and >
/// </summary>
/// <param name="xml">String to be escaped</param>
/// <returns>An xml string with < and ></returns>
private string EscapeXml(string xml)
{
string result = xml.Replace("<", "'<'");
result = result.Replace(""", "'quot'");
result = result.Replace(">", "'>'");
result = result.Replace("<", "<");
return result.Replace(">", ">");
}