method
check_until
Ruby latest stable (v2_5_5)
-
0 notes -
Class: StringScanner
check_until(p1)
public
This returns the value that #scan_until would return, without advancing the scan pointer. The match register is affected, though.
s = StringScanner.new("Fri Dec 12 1975 14:39") s.check_until /12/ # -> "Fri Dec 12" s.pos # -> 0 s.matched # -> 12
Mnemonic: it “checks” to see whether a #scan_until will return a value.