Mega Code Archive

 
Categories / Ruby / String
 

To convert a string into a symbol (Symbol class), use either the to_sym or intern methods

"name".intern # => :name "name".to_sym # => :name