473,320 Members | 1,865 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Convert StringWriter to StringReader

das
hello all,
might be a dumb one, I have a StringWriter to which I write some
text, after doing this I want to read this into a StringReader so that
I can manipulate the data
ex: while(strRdr.Peek() -1)
{
// Read data and load into a Physical File - StreamWriter
}

I know that this can be done easily if the text can be written to
FileWriter and then the StringReader reading from the physical file.

But I do not want to create a physical file, I want the Writer to be in
memory, do my text maipulation using StringReader and then create a
physical file.

Is this a totally dumb approach? Please advice.

thanks.

Aug 4 '06 #1
2 5630
"das" <Ad*******@gmail.comwrote:
might be a dumb one, I have a StringWriter to which I write some
text, after doing this I want to read this into a StringReader so that
I can manipulate the data
Sure. Use a StringWriter, write the data, then when you're done writing
call new StringReader(stringWriter.ToString()).

-- Barry

--
http://barrkel.blogspot.com/
Aug 4 '06 #2
das
Thanks Barry!
Wonder why I lack the IntelliGence to check the IntelliSense of
StringReader :)

Adios

Barry Kelly wrote:
"das" <Ad*******@gmail.comwrote:
might be a dumb one, I have a StringWriter to which I write some
text, after doing this I want to read this into a StringReader so that
I can manipulate the data

Sure. Use a StringWriter, write the data, then when you're done writing
call new StringReader(stringWriter.ToString()).

-- Barry

--
http://barrkel.blogspot.com/
Aug 4 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Brian Rogers | last post by:
To whom it may concern: Can anyone explain this behaviour in serialization and deserialization? I serialize an object using an XML serializer. I de-serialize the object from a StringReader and...
2
by: Henrik Skak Pedersen | last post by:
Hi, I am trying to convert a very basic WML document to HTML using the word2HTML.xsl stylesheet. But I get an exception when I am trying to convert it: The code looks like this: ...
5
by: jk | last post by:
I'm having trouble converting a datatable into xml, with resonse.write to aspx. I'm basically converting vb code that saved a recordset into a stream into c#, but the format is wrong. I've tried...
7
by: Randy | last post by:
Hello, Is there an easy way to convert a string to a stream? Thanks
2
by: muesliflakes | last post by:
I wish to receive some data from SqlServer as XML and write out result to as a string. Eg: cmd = new SqlCommand( "select * from blah for xml auto", con ); XmlReader result =...
1
by: dongxm | last post by:
XslTransform xslt = new XslTransform(); xslt.Load(myXmlReader) the myXmlReader is a XmlReader,but i have String of xsl file's content... how to do,String convert XmlReader? thanks
5
by: Ken Sturgeon | last post by:
Using VB.NET in VS2005, assume that you have a RegEx that matches a specific html tag; for instance "<title>.*?</title>" that returns a match "<title>SomeTitleHere</title>" and you want to convert...
0
by: BobbyS | last post by:
I've a xml file.I'm taking its data passing it to a method in string form and converting that string "xmlData" to a array of bytes by Convert.FromBase64String(xmlData) but I'm getting a exception...
0
by: =?Utf-8?B?cm9uZSBtYXRpYXM=?= | last post by:
I have the same task to do but everytime I tried to parse my code I get a null value returned after executing "dtMaterials.WriteXml(swMaterials);". I am using the following code: Hope you can hep...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.