VOOZH about

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

⇱ Ruby | Symbol slice function - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Ruby | Symbol slice function

Last Updated : 10 Dec, 2019
Symbol#slice() : slice() is a Symbol class method which slices the symbol object and return the character value.
Syntax: Symbol.slice() Parameter: Symbol values Return: slices the symbol object and return the character value.
Example #1 : Output :
Symbol a : aBcDeF

Symbol b : äöü

Symbol c : ABCDEF



Symbol a slice form : B

Symbol b slice form : ö

Symbol c slice form : D

Example #2 : Output :
Symbol a : geeks

Symbol b : åöó

Symbol c : GEEKS



Symbol a slice form : e

Symbol b slice form : ö

Symbol c slice form : K

Comment
Article Tags: