Maintenance Ruby 3.4 gets fixes, but no new features. Switch to Ruby 4.0 →
instance method
StringIO#each_char
() { (::String arg0) -> untyped } -> self
() -> ::Enumerator[::String, self]
each_char {|c| ... } → self
ext/stringio/stringio.c
View on GitHub ↗
static VALUE
strio_each_char(VALUE self)
{
VALUE c;
RETURN_ENUMERATOR(self, 0, 0);
while (!NIL_P(c = strio_getc(self))) {
rb_yield(c);
}
return self;
}
With a block given, calls the block with each remaining character in the stream; see Character IO.
With no block given, returns an enumerator.