C# – Creating a stream from a string

Ok.  I’m a .net newbie (have been for the past few years.)  But now I’m going to get passed all that, buckle down and learn it inside out.

One of the challenges that I have is some things require a “stream”.  So, you have a value in a variable but you can’t use it because it isn’t a stream. 

Well, finally got the solution to the problem:

StringReader strReader = new StringReader(stringVal);

Simple enough.  StringReader is a stream, and it takes a string value.

I got this solution from: weblogs.asp.net/whaggard/archive/2004/09/23/233535.aspx

Leave a Reply

Your email address will not be published. Required fields are marked *