the best way to censor words in golang

huangapple go评论65阅读模式
英文:

the best way to censor words in golang

问题

在使用Golang时,最佳的模式来屏蔽字符串中特定的滥用词汇是什么?

例如,将以下文本进行屏蔽:

Mark is a porn-star.

屏蔽后的结果应该是:

Mark is a p*******r.

我们需要将要屏蔽的词汇列表传递给相应的函数。

英文:

What is the best pattern to censor specific abuse words in string with golang?

For example censor this text:

> Mark is a porn-star.

to

> Mark is a p*******r.

from a list of words that we pass to it.

答案1

得分: 1

这个问题可以使用"strings"库函数来解决。

看看这个例子:
Golang简单的词语过滤或审查

英文:

This problem can be solved with "strings" library functions.

Look at this example:
Golang simple world filter o censor

huangapple
  • 本文由 发表于 2016年12月23日 07:30:46
  • 转载请务必保留本文链接:https://go.coder-hub.com/41293154.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定