一、转定义特殊符号
static public string Transferred(string Meaning) { //普通字符变换成转义字符 Meaning = Meaning.Replace("&", "&"); Meaning = Meaning.Replace("<", "<"); Meaning = Meaning.Replace(">", ">"); Meaning = Meaning.Replace("'", "'"); Meaning = Meaning.Replace(""", """); return Meaning; } static public string UnTransferred(string Meaning) { //转义字符变换成普通字符 Meaning = Meaning.Replace("<", "<"); Meaning = Meaning.Replace(">", ">"); Meaning = Meaning.Replace("'", "'"); Meaning = Meaning.Replace(""", """); Meaning = Meaning.Replace("&", "&"); return Meaning; }
二、百度富文本框设置输入字数限制
百度编辑器ueditor 字符限制 默认只能输入10000个字符 修改 ueditor.config.js // ,wordCount:true //是否开启字数统计 // ,maximumWords:10000 //允许的最大字符数 把注释代码放开 修改成 ,wordCount:false //是否开启字数统计 ,maximumWords:1000000 //允许的最大字符数