I want to remove the braces so "{test}" becomes "test". I tried
"{test}".gsub(/\{(.*)\}/,$1)
while "{test}".gsub!(/(\{).*(\})/,""); end
"{test}".gsub(/\{.*\}/,"")
Nothing seems to work.
You have to use \1, not $1
"{test}".gsub /\{(.*)\}/, '\1'
Or, if you just want to delete all curly braces:
"{test}".delete "{}"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With