Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How can I replace a word filled with hashtags to "TAGS"?

Hey, I need to know how I can replace a word with hashtags (####) or a single hashtag (#) with "TAGS" (or something else), I'm making a chat and I don't like the Hashtags filter so replacing it would be nice Ik its something related to

string.gsub()

but I really don't know how to use that, any help on this would be appreciated :p

1 answer

✓ Accepted answer

Wow is everyone sleeping? This is a very simple question I'm surprised it wasn't answered.

local str = "####"

str = string.gsub(str, "#", "TAG")

print(str)

-- Output: TAGTAGTAGTAG

The first argument is the string that you want to change, The second argument is the pattern that you want to change, The third argument is what you want to change the pattern to.

1 comment

0

welp It's sleeping helpers now.

This discussion is preserved as it was. New answers, comments, and votes are closed.