How to replace a word from a string?

How to replace a string?

e.x: “:emoji:” to " :flushed: "

6 Likes

Can you explain more clearly? I don’t seem to understand…

1 Like
local name = ":flushed:"

-- I want to replace :flushed: for something.

string.gsub(":emoji hahaha", ":emoji", "newStringHere")

8 Likes

But I have a problem, it all works but when I print it it puts:

EMOJI 1

script:

local new = ":flushed:"

print(string.gsub(new, ":flushed:", "EMOJI"))
2 Likes

Legit don’t know! I’m guessing it has something to do with gsub?

local new = ":flushed:"

 new = string.gsub(new, ":flushed:", "EMOJI"); print(new)

Ah sorry, you need to use it like this.

4 Likes

Thank you! I will use it! TSYM

2 Likes