Skip to content

End of Life Ruby 3.0 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →

instance method

StringIO#write

strio.write(string, ...) → integer
strio.syswrite(string) → integer

Appends the given string to the underlying buffer string. The stream must be opened for writing. If the argument is not a string, it will be converted to a string using to_s. Returns the number of bytes written. See IO#write.

See also #ungetc #ungetbyte also in 4.1 · 4.0 · 3.4 · 3.3 · 3.2 · 3.1