method

size

Importance_1
Ruby latest stable (v2_5_5) - 0 notes - Class: StringScanner
size() public

Returns the amount of subgroups in the most recent match. The full match counts as a subgroup.

s = StringScanner.new("Fri Dec 12 1975 14:39")
s.scan(/(\w+) (\w+) (\d+) /)       # -> "Fri Dec 12 "
s.size                             # -> 4
Show source
Register or log in to add new notes.