String to Symbol : intern « String « Ruby






String to Symbol


"one".to_sym       # => :one -- string to symbol conversion
"two".intern       # => :two -- intern is a synonym for to_sym

 

Related examples in the same category

1.Intern a string