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 the scan pointer.
Example #1 :
# 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 code for StringIO.check_until() method # loading StringIO require 'strscan' # declaring StringIO c = StringScanner. new ( "helloBeginner" ) # check_until() method puts "String Scanner check_until form : #{c.check_until /ge/}\n\n" |
Output :
String Scanner check_until form : helloge
Contact Us