笔记

一、转定义特殊符号

     static public string Transferred(string Meaning)
        {
            //普通字符变换成转义字符
            Meaning = Meaning.Replace("&", "&");
            Meaning = Meaning.Replace("<", "&lt;");
            Meaning = Meaning.Replace(">", "&gt;");
            Meaning = Meaning.Replace("'", "&apos;");
            Meaning = Meaning.Replace("\"", "&quot;");
            return Meaning;
        }


        static public string UnTransferred(string Meaning)
        {
            //转义字符变换成普通字符
            Meaning = Meaning.Replace("&lt;", "<");
            Meaning = Meaning.Replace("&gt;", ">");
            Meaning = Meaning.Replace("&apos;", "'");
            Meaning = Meaning.Replace("&quot;", "\"");
            Meaning = Meaning.Replace("&amp;", "&");
            return Meaning;
        }

二、百度富文本框设置输入字数限制

百度编辑器ueditor 字符限制

默认只能输入10000个字符

修改 ueditor.config.js

// ,wordCount:true          //是否开启字数统计
       // ,maximumWords:10000       //允许的最大字符数
      把注释代码放开
      修改成
        ,wordCount:false          //是否开启字数统计
        ,maximumWords:1000000       //允许的最大字符数
posted @ 2020-01-14 15:50  锦大大的博客呀!  阅读(181)  评论(0编辑  收藏  举报