Remove parentheses and its contents from a string?

Hi!

I’m trying to remove a part of a string that’s in parentheses, but I can’t seem to figure it out

For example, if I have a string such as this: Hello (World), and I want to make it so it just outputs Hello, how would I go about doing this? I’m aware of string.sub / string.gsub but I can’t quite understand how to get them to work. Any help will be appreciated!

Many thanks!

After looking further on non-Roblox related Lua stuff, I’ve found what I was looking for:

string:gsub('%b()', '') 
1 Like