Covert a String to a TextStream?

BlitzMax Forums/BlitzMax Programming/Covert a String to a TextStream?

A RAM Stream points directly to a buffer/string. This is faster than the option above since there's no copying involved.

Local str:String
Local stream:TStream

str = "this is a test"
stream = CreateRamStream(str, str.length, True, False)

Print stream.ReadString(5)


But careful with that, writing beyond the length of the stream will cause problems.