Skip to content
instance method

StringScanner#rest

() -> ::String
rest → target_substring

Returns the ‘rest’ of the stored string (all after the current position), which is the target substring:

Example
scanner = StringScanner.new('foobarbaz')
scanner.rest # => "foobarbaz"
scanner.pos = 3
scanner.rest # => "barbaz"
scanner.terminate
scanner.rest # => ""
See also #reset #rest_size #pre_match #scan also in 4.1 · 3.4 · 3.3 · 3.2 · 3.1 · 3.0