Skip to content
Related Articles

Related Articles

Improve Article
Save Article
Like Article

Ruby | Symbol downcase value

  • Last Updated : 10 Dec, 2019

Symbol#downcase() : downcase() is a Symbol class method which returns the downcased form of symbol based on the position of next capital form.

Syntax: Symbol.downcase()

Parameter: Symbol values

Return: the downcased form of symbol based on the position of next capital form.

Example #1 :






# Ruby code for Symbol.downcase() method
  
# declaring Symbol 
a = :aBcDeF
  
# declaring Symbol
b = :"\u{e4 f6 fc}"
  
# declaring Symbol
c = :ABCDEF
  
# Symbol 
puts "Symbol a : #{a}\n\n"
puts "Symbol b : #{b}\n\n"
puts "Symbol c : #{c}\n\n\n\n"
  
  
# downcase form 
puts "Symbol a downcase form : #{a.downcase}\n\n"
puts "Symbol b downcase form : #{b.downcase}\n\n"
puts "Symbol c downcase form : #{c.downcase}\n\n"

Output :

Symbol a : aBcDeF

Symbol b : äöü

Symbol c : ABCDEF



Symbol a downcase form : abcdef

Symbol b downcase form : äöü

Symbol c downcase form : abcdef

Example #2 :




# Ruby code for Symbol.downcase() method
  
# declaring Symbol 
a = :geeks
  
# declaring Symbol
b = :"\u{e5 f6 f3}"
  
# declaring Symbol
c = :GEEKS
  
# Symbol 
puts "Symbol a : #{a}\n\n"
puts "Symbol b : #{b}\n\n"
puts "Symbol c : #{c}\n\n\n\n"
  
  
# downcase form 
puts "Symbol a downcase form : #{a.downcase}\n\n"
puts "Symbol b downcase form : #{b.downcase}\n\n"
puts "Symbol c downcase form : #{c.downcase}\n\n"

Output :

Symbol a : geeks

Symbol b : åöó

Symbol c : GEEKS



Symbol a downcase form : geeks

Symbol b downcase form : åöó

Symbol c downcase form : geeks




My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!