摘要: 这两天突然想到了脏字过滤 就结合网上找到的资料自己写了一个,脏字数量700+(效率不是很高 测试在110多KB的情况下比replace快 3-4倍)测试结果图 单位:秒代码System.Text.StringBuilder sb = new System.Text.StringBuilder(text.Length); string filterText = "需要过滤的脏字 以|分开";//脏字 可根据自己的方式用分隔符 string[] filterData = filterText.Split('|'); foreach ... 阅读全文
posted @ 2012-10-15 10:31 喻家军 阅读(4451) 评论(9) 推荐(1) 编辑