zoukankan      html  css  js  c++  java
  • 正则 发帖时判断是否包含违禁词,批量替换违禁词为***

    string words = "草|红军|法法|尼玛|点点";
    string tmp = FormatWords(words);
    string content = "的手机发来的就撒了福建代理商叫饭藏大立草科技飞尼玛洒了法法解到了司法局了解到萨拉放假了多少积分";
    string dd = Regex.Replace(content, words, "***", RegexOptions.IgnoreCase);

    //bool d = Regex.IsMatch(content, words, RegexOptions.IgnoreCase);

  • 相关阅读:
    LeetCode
    LeetCode
    LeetCode
    LeetCode
    LeetCode
    LeetCode
    LeetCode
    LeetCode
    LeetCode
    LeetCode
  • 原文地址:https://www.cnblogs.com/niaowo/p/3678495.html
Copyright © 2011-2022 走看看