473,322 Members | 1,493 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,322 software developers and data experts.

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

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
nj********@hotmail.com
http://www.nathansokalski.com/
Nov 19 '05 #1
2 1906
Nathan,

You mean something as
cellPoemText.Text = poemstreamreader.ReadToEnd()
poemstreamreader.Close()


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

I hope this helps,

Cor
Nov 19 '05 #2
"Nathan Sokalski" <nj********@hotmail.com> 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

Nov 19 '05 #3

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

Similar topics

3
by: mudassar | last post by:
Hello I've been trying to figure this problem out for quite a while and I'm having no joy. I'll give you some background info, I'm creating a form and one of the fields in the form is a big ...
11
by: Jakanapes | last post by:
Hi all, I'm looking for a way to scan a block of text and replace all the double quotes (") with single quotes ('). I'm using PHP to pull text out of a mySQL table and then feed the text into...
3
by: Kevin | last post by:
I know this has probably been discussed many times before (I found answers when I searched yesterday), but I still can't get it to work... I have an attribute @OID that can contain any...
5
by: SStory | last post by:
How can I handle the user entering single quotes like in Bob's mini mart? If I use command objects will this no longer be an issue? I guess that would mean no simple adhoc SQL statements...
7
by: gar | last post by:
Hi, I need to replace all the double quotes (") in a textbox with single quotes ('). I used this code text= Replace(text, """", "'" This works fine (for normal double quotes).The problem...
2
by: Nathan Sokalski | last post by:
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...
3
by: Solution Seeker | last post by:
I want to Store the String value with Single Quotes in the Field of Database where if i try to Store the String value with Single Quotes (as it is) then it is throwing the error as SQL String...
4
by: Justin Fancy | last post by:
Hi everyone, I need to replace all instances of a double quote(") with two single quotes('') in a text file. I already have some replacements of strings going on, but I tried this one, but the...
7
by: nick.bonadies | last post by:
I'm trying to deal with user inputs of single quotes into form fields that get input into a MSSQL database. So far I have discovered that if I turn on magic_quotes_sybase in my php.ini file PHP...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
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...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
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: 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
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.