VOOZH about

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

⇱ Ruby | Symbol match function - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Ruby | Symbol match function

Last Updated : 9 Dec, 2019
Symbol#match() : match() is a Symbol class method which matches the pattern with symbol.
Syntax: Symbol.match() Parameter: Symbol values Return: position - if pattern matches the Symbol otherwise return nil
Example #1 : Output :
Symbol a : aBcDeF

Symbol b : äöü

Symbol c : ABCDEF



Symbol a match form : 3

Symbol b match form : 

Symbol c match form : 2

Example #2 : Output :
Symbol a : geeks

Symbol b : åöó

Symbol c : GEEKS



Symbol a match form : 0

Symbol b match form : 

Symbol c match form : 1
Comment
Article Tags: