Many of us need to deal with user input, search queries, and situations where the input text can potentially contain profanity or undesirable language. Oftentimes this needs
Don't.
Because:
Edit: While I agree with the commenter who said "censorship is wrong", that is not the nature of this answer.