Ruby | StringScanner check_until function Last Updated : 12 Dec, 2019 Summarize Comments Improve Suggest changes Share Like Article Like Report 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 the scan pointer. Example #1 : Ruby # Ruby code for StringIO.check_until() method # loading StringIO require 'strscan' # declaring StringIO c = StringScanner.new("Fri Dec 12 1975 14:39") # check_until() method puts "String Scanner check_until form : #{c.check_until /1975/}\n\n" Output : String Scanner check_until form : Fri Dec 12 1975 Example #2 : Ruby # Ruby code for StringIO.check_until() method # loading StringIO require 'strscan' # declaring StringIO c = StringScanner.new("hellogeeks") # check_until() method puts "String Scanner check_until form : #{c.check_until /ge/}\n\n" Output : String Scanner check_until form : helloge Comment More infoAdvertise with us Next Article Ruby | StringScanner skip_until function M mayank5326 Follow Improve Article Tags : Ruby Ruby-Methods Ruby String Scanner-class Similar Reads Ruby | StringScanner check function 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 : R 1 min read Ruby | StringScanner scan_until function StringScanner#scan_until() : scan_until() is a StringScanner class method which scans the string until the pattern is matched Syntax: StringScanner.scan_until() Parameter: StringScanner values Return: the substring up to and including the end of the match Example #1 : Ruby # Ruby code for StringScan 1 min read Ruby | StringScanner skip_until function StringScanner#skip_until() : skip_until() is a StringScanner class method which returns the number of bytes advanced, or nil if no match was found. Syntax: StringScanner.skip_until() Parameter: StringScanner values pattern Return: the number of bytes advanced, or nil if no match was found. Example # 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 unscan function StringScanner#unscan() : unscan() is a StringScanner class method which set the scan pointer to the previous position Syntax: StringScanner.unscan() Parameter: StringScanner values Return: set the scan pointer to the previous position Example #1 : Ruby # Ruby code for StringScanner.unscan() method # 1 min read Like