VOOZH about

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

⇱ Ruby | Symbol length function - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Ruby | Symbol length function

Last Updated : 10 Dec, 2019
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 : Output :
Symbol a : aBcDeF

Symbol b : äöü

Symbol c : ABCDEF



Symbol a length form : 6

Symbol b length form : 3

Symbol c length form : 6

Example #2 : Output :
Symbol a : geeks

Symbol b : åöó

Symbol c : GEEKS



Symbol a length form : 5

Symbol b length form : 3

Symbol c length form : 5

Comment
Article Tags: