In Java, one can create an IO stream from a String like so:
Reader r = new StringReader("my text");
I'd like to be able to do the same in Ruby so I can take a string and treat it as an IO stream.
r = StringIO.new("my text")
And here's the documentation.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With