I'm trying to create a symbol in ruby with brackets. For example when I do the following:
2.0.0p247 :007 > {hello: "something"}
=> {:hello=>"something"}
This should be fine. However if I wanted to do "hello[]
" as the symbol how would I do this?
Surround the name of the symbol in quotes:
:'hello[]'
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