Ruby for Instance / Strings And Symbols

# Define a string and convert it to a symbol
my_string = "hello"
my_symbol = my_string.to_sym

# Define a symbol and convert it to a string
my_symbol = :hello
my_string = my_symbol.to_s

# Define a symbol and access its value
my_symbol = :hello
puts my_symbol

Try on playground

Next: structs

made with by dfxe / source / license