Skip to content

CensorString does not censor if swear word is surrounded by other characters #34

Description

@KyleHennessy

When using the CensorString method, it will only censor the swear words if they appear exactly as they do in the profanity list

This will censor the string

_filter.CensorString("hell") returns "****"

This will also censor the string

_filter.CensorString("hell hell") returns "**** ****" 

This will not censor the string however

_filter.CensorString("hellhell") returns "hellhell"

What is unusual though is that if I call the ContainsProfanity method on that same input, it will detect that profanity is in the string

_filter.ContainsProfanity("hellhell") returns true

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions