Robert said:
What is the best way to convert a variable of type string to the IO.Stream
object?
Assuming you want the string's stream encoded in UTF8:
System.IO.MemoryStream = new System.IO.MemoryStream(
System.Text.Encoding.UTF8.GetBytes( "the string"));
Depending on what you really want to do, you might be better served
using the StringReader class. It's not an IO.Stream, but it makes for
easy text-oriented reading of a string.