Looking for ruby Answers? Try Ask4KnowledgeBase
Looking for ruby Keywords? Try Ask4Keywords

Ruby Language Converting a String to Symbol


Example

Given a String:

s = "something"

there are several ways to convert it to a Symbol:

s.to_sym
# => :something
:"#{s}"
# => :something