Code Editor
Learn
Hashes and Symbols

Converting Between Symbols and Strings

Converting between strings and symbols is a snap.

:sasquatch.to_s # ==> "sasquatch" "sasquatch".to_sym # ==> :sasquatch

The .to_s and .to_sym methods are what you're looking for!

Report a Bug
If you see a bug or any other issue with this page, please report it here.