❔ How to censor a bad word in capital letters without changing original letters case?
I'm trying to loop through a list of bad words to filter them out, but when their case is different I had to use ToLower() which changes the case of original message completely to lower:
12 Replies
just add another string
C# strings are immutable classes. So when you do something like
It will print:
aaaa
bbbb
I want to retain the org msg case, which might be "THIS IS BAD MSG", ToLower() converts the whole msg to lower before replacing the bad word.
@Moataz Let's say if the word you want to censor is "BLUE" would it get replaced by "bad" or "BAD"?
You could try with StringBuilder
Since Strings in C# are immutable, StringBuilder in this case can help (they're mutable)
How did you created those links?
Discord supports markdown
Discord
Markdown Text 101 (Chat Formatting: Bold, Italic, Underline)
Want to inject some flavor into your everyday text chat? You're in luck! Discord uses Markdown, a simple plain text formatting system that'll help you make your sentences stand out. Here's how to d...
Thanks a lot!
You can use regex to do case-insensitive replace: https://stackoverflow.com/a/6276004/6042255
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.