Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > System.IO.StreamReader is not returning single quotes from my file

Reply
Thread Tools

System.IO.StreamReader is not returning single quotes from my file

 
 
Nathan Sokalski
Guest
Posts: n/a
 
      06-07-2005
I am using a System.IO.StreamReader to read a text file that was created
with Notepad. It is returning everything except the single quotes (at least
that is the only thing I have noticed it is not returning). The code I am
using is:

Dim poemstreamreader As System.IO.StreamReader

poemstreamreader = System.IO.File.OpenText(Global.Poems(poemtitle))

cellPoemText.Text = poemstreamreader.ReadToEnd()

poemstreamreader.Close()


I know that it is reading from the correct file, because it is returning all
the characters correctly, I simply need to know how to make it not discard
special characters such as single quotes. How do I do this? Thanks.
--
Nathan Sokalski
http://www.velocityreviews.com/forums/(E-Mail Removed)
http://www.nathansokalski.com/


 
Reply With Quote
 
 
 
 
Cor Ligthert
Guest
Posts: n/a
 
      06-07-2005
Nathan,

You mean something as

> cellPoemText.Text = poemstreamreader.ReadToEnd()
> poemstreamreader.Close()


cellPoemText.Text = cellPoemText.Text.Replace("'","")

I hope this helps,

Cor


 
Reply With Quote
 
 
 
 
Armin Zingler
Guest
Posts: n/a
 
      06-07-2005
"Nathan Sokalski" <(E-Mail Removed)> schrieb
>I am using a System.IO.StreamReader to read a text file that was
> created with Notepad. It is returning everything except the single quotes
> (at
> least that is the only thing I have noticed it is not returning).
> The code I am using is:
>
> Dim poemstreamreader As System.IO.StreamReader
>
> poemstreamreader =
> System.IO.File.OpenText(Global.Poems(poemtitle))
> cellPoemText.Text = poemstreamreader.ReadToEnd()
>
> poemstreamreader.Close()
>
>
> I know that it is reading from the correct file, because it is
> returning all the characters correctly, I simply need to know how to
> make it not discard special characters such as single quotes. How do
> I do this?



Don't know if this helps:

poemstreamreader = new io.streamreader(Global.Poems(poemtitle),
system.text.encoding.default)

This assumes ANSI encoding of the file.


Armin

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to put a single quote in a JS var defined by single quotes gimme_this_gimme_that@yahoo.com Javascript 2 07-07-2008 03:00 AM
Backticks with single quote inside single quotes john.d.russell@gmail.com Perl Misc 10 04-17-2006 01:31 AM
Asp.NET Javascript string, want to pass '(single quotes' within '(single quotes) Chris ASP .Net 1 03-24-2006 09:03 PM
Quotes/Double Quotes in Image Control Chris White ASP .Net 1 09-22-2004 06:22 AM
Multiline quotes - escaping quotes - et al Lawrence Tierney Java 3 12-24-2003 05:12 PM



Advertisments