zoukankan      html  css  js  c++  java
  • HTML特殊转义字符列表

    HTML特殊转义字符列表
    最常用的字符实体
    Character Entities
    显示 说明 实体名称 实体编号
    半方大的空白    
    全方大的空白    
    不断行的空白格    
    < 小于 &lt; &#60;
    > 大于 &gt; &#62;
    & &符号 &amp; &#38;
    " 双引号 &quot; &#34;
    ? 版权 &copy; &#169;
    ? 已注册商标 &reg; &#174;
    ? 商标(美国) ? &#8482;
    × 乘号 &times; &#215;
    ÷ 除号 &divide; &#247;



    /// <summary>
    /// Replaces the &lt; with the less then symbol and &gt; 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("&lt;", "<");
    result = result.Replace("&gt;", ">");
    result = result.Replace("'<'", "&lt;");
    result = result.Replace("'quot'", "&quot;");
    return result.Replace("'>'", "&gt;");
    }

    /// <summary>
    /// Replaces the less then and greater then symbol with &lt; and &gt;
    /// </summary>
    /// <param name="xml">String to be escaped</param>
    /// <returns>An xml string with &lt; and &gt;</returns>
    private string EscapeXml(string xml)
    {
    string result = xml.Replace("&lt;", "'&lt;'");
    result = result.Replace("&quot;", "'quot'");
    result = result.Replace("&gt;", "'&gt;'");
    result = result.Replace("<", "&lt;");
    return result.Replace(">", "&gt;");
    }

  • 相关阅读:
    Java字符串(String类)
    Java异常处理
    Scanner使用方法
    OOP之重载
    构造函数和析构函数
    类、对象、方法
    函数
    数组
    ahk之路:利用ahk在window7下实现窗口置顶
    指针的问题
  • 原文地址:https://www.cnblogs.com/zhangchenliang/p/2391961.html
Copyright © 2011-2022 走看看