Skip to content

Maintenance Ruby 3.3 gets fixes, but no new features. Switch to Ruby 4.0 →

instance method

StringScanner#eos?

eos?

Returns true if the scan pointer is at the end of the string.

Example
s = StringScanner.new('test string')
p s.eos?          # => false
s.scan(/test/)
p s.eos?          # => false
s.terminate
p s.eos?          # => true
See also #empty? #exist? #concat #fixed_anchor? also in 4.1 · 4.0 · 3.4 · 3.2 · 3.1 · 3.0