R
Robert Strickland
What is the best way to convert a variable of type string to the IO.Stream
object?
object?
Robert said:What is the best way to convert a variable of type string to the IO.Stream
object?
mikeb said: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.
Robert said:Thanks for your help. I have one more question. I need to reverse the
process - convert something typed as stream to string.
Thanks again