C# Class Censored.Censor

A .NET library to easily easily detect and censor words
Show file Open project: jamesmontemagno/Censored Class Usage Examples

Public Methods

Method Description
Censor ( IEnumerable censoredWords = null ) : System

Initializes a new instance of the Censored.Censor class.

CensorText ( string text ) : string

Censors the text and replaces dirty words with ****

HasCensoredWord ( string text ) : bool

Determines whether the text is dirty (has a bad word in it).

Private Methods

Method Description
StarCensoredMatch ( Group m ) : string
ToRegexPattern ( string wildcardSearch ) : string

Method Details

Censor() public method

Initializes a new instance of the Censored.Censor class.
public Censor ( IEnumerable censoredWords = null ) : System
censoredWords IEnumerable Censored words, if null uses default list
return System

CensorText() public method

Censors the text and replaces dirty words with ****
public CensorText ( string text ) : string
text string Text to censor
return string

HasCensoredWord() public method

Determines whether the text is dirty (has a bad word in it).
public HasCensoredWord ( string text ) : bool
text string Text to check for dirty words.
return bool