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: http://weblogs.asp.net/whaggard/archive/2004/09/23/233535.aspx

0 comments ↓

There are no comments yet...Kick things off by filling out the form below.

You must log in to post a comment.