Ruby | Symbol inspect function Last Updated : 10 Dec, 2019 Comments Improve Suggest changes Like Article Like Report Symbol#inspect() : inspect() is a Symbol class method which returns the string representation of the symbol value. Syntax: Symbol.inspect() Parameter: Symbol values Return: the string representation of the symbol value. Example #1 : Ruby # Ruby code for Symbol.inspect() method # declaring Symbol a = :aBcDeF # declaring Symbol b = :"\u{e4 f6 fc}" # declaring Symbol c = :ABCDEF # inspect form puts "Symbol a inspect form : #{a.inspect}\n\n" puts "Symbol b inspect form : #{b.inspect}\n\n" puts "Symbol c inspect form : #{c.inspect}\n\n" Output : Symbol a inspect form : :aBcDeF Symbol b inspect form : :"\u00E4\u00F6\u00FC" Symbol c inspect form : :ABCDEF Example #2 : Ruby # Ruby code for Symbol.inspect() method # declaring Symbol a = :geeks # declaring Symbol b = :"\u{e5 f6 f3}" # declaring Symbol c = :GEEKS # inspect form puts "Symbol a inspect form : #{a.inspect}\n\n" puts "Symbol b inspect form : #{b.inspect}\n\n" puts "Symbol c inspect form : #{c.inspect}\n\n" Output : Symbol a inspect form : :geeks Symbol b inspect form : :"\u00E5\u00F6\u00F3" Symbol c inspect form : :GEEKS Comment More infoAdvertise with us Next Article Ruby | Symbol inspect function M mayank5326 Follow Improve Article Tags : Ruby Ruby-Methods Ruby Symbol-class Similar Reads Ruby | Symbol next function Symbol#next() : next() is a Symbol class method which returns the next symbol object. Syntax: Symbol.next() Parameter: Symbol values Return: the next symbol object. Example #1 : Ruby # Ruby code for Symbol.next() method # declaring Symbol a = :aBcDeF # declaring Symbol b = :"\u{e4 f6 fc}" 2 min read Ruby | Symbol intern function Symbol#intern() : intern() is a Symbol class method which returns the object corresponding to symbol. Syntax: Symbol.intern() Parameter: Symbol values Return: the object corresponding to symbol Example #1 : Ruby # Ruby code for Symbol.intern() method # declaring Symbol a = :aBcDeF # declaring Symbol 1 min read Ruby | Symbol id2name function Symbol#id2name() : id2name() is a Symbol class method which returns the name or string corresponding to symbol Syntax: Symbol.id2name() Parameter:Symbol values Return: the name or string corresponding to symbol Example #1 : Ruby # Ruby code for Symbol.id2name() method # declaring Symbol a = :aBcDeF 1 min read Ruby | Symbol length function Symbol#length() : length() is a Symbol class method which returns the length of the symbol. Syntax: Symbol.length() Parameter: Symbol values Return: the length of the symbol Example #1 : Ruby # Ruby code for Symbol.length() method # declaring Symbol a = :aBcDeF # declaring Symbol b = :"\u{e4 f6 2 min read Ruby | Symbol == function Symbol#==() : ==() is a Symbol class method which compares two Symbol objects. Syntax: Symbol.==() Parameter: Symbol values Return: true if two Symbols are equal otherwise return false Example #1 : Ruby # Ruby code for Symbol.==() method # declaring Symbol a = :aBcDeF # declaring Symbol b = :"\ 2 min read Like