End of Life Ruby 3.1 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
instance method
StringScanner#eos?
eos?
ext/strscan/strscan.c
View on GitHub ↗
static VALUE
strscan_eos_p(VALUE self)
{
struct strscanner *p;
GET_SCANNER(self, p);
return EOS_P(p) ? Qtrue : Qfalse;
}
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