unity对敏感词库处理的记录
string txt = Resources.Load<TextAsset>("minganci").ToString(); //string txt = "撒谎、打算、撒 旦、ASsdf"; txt = txt.Replace("、", "|");//、改 | txt = txt.Replace(" ", "");//删除空格 txt = txt.ToLower();//全部小写 Debug.Log(txt); //写入文件 File.AppendAllText("E://UnityProject/敏感词库修正/新建文件夹/MinGanCi3.txt", txt, Encoding.UTF8);
敏感词库对大小写也有要求,这里我就全部转小写,检查时也将转为小写检查