Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to take a stringbuilder and convert it to a streamReader?

How to take a stringbuilder and convert it to a stream?

SO my stringbuilder has to be converted into a :

StreamReader stream = ????

Update

I tried using a stringreader like:

StringReader sr = new StringReader(sb.ToString());
StreamReader stream = new StreamReader(sr);

but that doesn't work?

like image 663
Blankman Avatar asked Feb 21 '10 04:02

Blankman


1 Answers

Use ToString to convert the StringBuilder into a String, and use a StringReader to wrap the String as a Stream.

like image 159
Andy Jacobs Avatar answered Sep 26 '22 12:09

Andy Jacobs