VOOZH about

URL: https://www.geeksforgeeks.org/ruby/ruby-symbol-to_s-function/

⇱ Ruby | Symbol to_s function - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Ruby | Symbol to_s function

Last Updated : 10 Dec, 2019
Symbol#to_s() : to_s() is a Symbol class method which returns string representation of the symbol object.
Syntax: Symbol.to_s() Parameter: Symbol values Return: string representation of the symbol object.
Example #1 : Output :
Symbol a to_s form : aBcDeF

Symbol b to_s form : äöü

Symbol c to_s form : ABCDEF

Example #2 : Output :
Symbol a to_s form : geeks

Symbol b to_s form : åöó

Symbol c to_s form : GEEKS

Comment
Article Tags: