Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR RUBY

ruby string to symbol

s = "something"

# First method
s.to_sym
# => :something

# A second method
:"#{s}"
# => :something
Source by riptutorial.com #
 
PREVIOUS NEXT
Tagged: #ruby #string #symbol
ADD COMMENT
Topic
Name
2+2 =