The value of the string, not its name, becomes the symbol : Convert to Symbol « String « Ruby






The value of the string, not its name, becomes the symbol


play = "this is a test".intern 

 

Related examples in the same category

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