Skip to content

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

@KyleHennessy

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

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