Ruby | StringScanner check function Last Updated : 12 Dec, 2019 Summarize Comments Improve Suggest changes Share Like Article Like Report StringScanner#check() : check() is a StringScanner class method which returns the value that scan would return, without advancing the scan pointer Syntax: StringScanner.check() Parameter: StringScanner values Return: the value that scan would return, without advancing the scan pointer Example #1 : Ruby # Ruby code for StringIO.check() method # loading StringIO require 'strscan' # declaring StringIO c = StringScanner.new("Fri Dec 12 1975 14:39") # check() method puts "String Scanner check form : #{c.check /Fri/}\n\n" Output : String Scanner check form : Fri Example #2 : Ruby # Ruby code for StringIO.check() method # loading StringIO require 'strscan' # declaring StringIO c = StringScanner.new("hellogeeks") # check() method puts "String Scanner check form : #{c.check /hel/}\n\n" Output : String Scanner check form : hel Comment More infoAdvertise with us Next Article Ruby | StringScanner clear function M mayank5326 Follow Improve Article Tags : Ruby Ruby-Methods Ruby String Scanner-class Similar Reads Ruby | StringScanner check_until function StringScanner#check_until() : check_until() is a StringScanner class method which returns the value that scan_until would return, without advancing the scan pointer. Syntax: StringScanner.check_until() Parameter: StringScanner values Return: the value that scan_until would return, without advancing 1 min read Ruby | StringScanner eos? function StringScanner#eos?() : eos?() is a StringScanner class method which checks whether the scan pointer is at the end of the string. Syntax: StringScanner.eos?() Parameter: StringScanner values Return: true if the scan pointer is at the end of the string otherwise return false Example #1 : Ruby # Ruby c 1 min read Ruby | StringScanner clear function StringScanner#clear() : clear() is a StringScanner class method which terminates the stringIO and returns an Enumerator object for the StringIO. Syntax: StringScanner.clear() Parameter: StringScanner values Return: terminates the stringIO and returns an Enumerator object for the StringIO. Example #1 1 min read Ruby | StringScanner exist? function StringScanner#exist?() : exist?() is a StringScanner class method which returns the value of pointer if the pattern exists. Syntax: StringScanner.exist?()Parameter: StringScanner valuesReturn: the value of pointer - if the pattern exists otherwise return nil. Example #1 :  Ruby # Ruby code for Str 1 min read Ruby | StringScanner empty? function StringScanner#empty?() : empty?() is a StringScanner class method which checks whether the stringIO is empty. Syntax: StringScanner.empty?() Parameter: StringScanner values Return: true - if the stringIO is empty otherwise return false Example #1 : Ruby # Ruby code for StringIO.empty?() method # loa 1 min read Ruby | StringScanner charpos function StringScanner#charpos() : charpos() is a StringScanner class method which returns the character position of the scan pointer. Syntax: StringScanner.charpos() Parameter: StringScanner values Return: the character position of the scan pointer Example #1 : Ruby # Ruby code for StringIO.charpos() method 1 min read Like