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

[SOLVED] How do I ignore parentheses in a string?

So say I have a string that looks like this

local Str = "The sanctions were (White)"

and I find the first character class with parentheses

Str = string.match(Str, "%b()")

It'd come out as (White), whereas I want it to come out as White to be used for finding a brickcolor.

How do I ignore the parentheses in this string?

1 answer

I used string:sub() to remove the parentheses.

local brackets = string.match(NewStr, "%(.+%)")
if brackets then
  brackets = brackets:sub(2, -2)
  print(brackets)
end

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