Ruby | Symbol intern function Last Updated : 10 Dec, 2019 Comments Improve Suggest changes Like Article Like Report 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 b = :"\u{e4 f6 fc}" # declaring Symbol c = :ABCDEF # intern form puts "Symbol a intern form : #{a.intern}\n\n" puts "Symbol b intern form : #{b.intern}\n\n" puts "Symbol c intern form : #{c.intern}\n\n" Output : Symbol a intern form : aBcDeF Symbol b intern form : äöü Symbol c intern form : ABCDEF Example #2 : Ruby # Ruby code for Symbol.intern() method # declaring Symbol a = :geeks # declaring Symbol b = :"\u{e5 f6 f3}" # declaring Symbol c = :GEEKS # intern form puts "Symbol a intern form : #{a.intern}\n\n" puts "Symbol b intern form : #{b.intern}\n\n" puts "Symbol c intern form : #{c.intern}\n\n" Output : Symbol a intern form : geeks Symbol b intern form : åöó Symbol c intern form : GEEKS Comment More infoAdvertise with us Next Article Ruby | Symbol intern 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 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 inspect function 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 = 1 min read Ruby | Symbol =~ function Symbol#=~() : =~() is a Symbol class method which =~es the pattern with symbol. Syntax: Symbol.=~() Parameter: Symbol values Return: position - if pattern =~es the Symbol otherwise return nil Example #1 : Ruby # Ruby code for Symbol.=~() method # declaring Symbol a = :aBcDeF # declaring Symbol b = : 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