How to create an IOBuffer backed by a String

This code works and is the way you should do it:

julia> data = "my data"
"my data"

julia> io = IOBuffer(data)
IOBuffer(data=UInt8[...], readable=true, writable=false, seekable=true, append=false, size=7, maxsize=Inf, ptr=1, mark=-1)
1 Like