English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories



The above line is what i want to write as the first line inside a file.
But as you wud imagine using quote inside a string is giving me an error. any help ?

Dim fstream As New FileStream(sfd.FileName, FileMode.OpenOrCreate, FileAccess.ReadWrite)
Dim sr As StreamWriter = New StreamWriter(fstream)
sr.WriteLine("")
'sr.WriteLine("") still is same



In the above line quotes are missing and i can't write quote ... i am sure u must hav understood wht i am saying.

2006-07-16 07:00:57 · 4 answers · asked by Alpha-Male 1 in Computers & Internet Programming & Design

Excellento... u guyz are great !

2006-07-16 07:13:15 · update #1

4 answers

try two things:

Doubling it - (This is how it's done in ASP)
sr.WriteLine("")

Or try using the char code (This is how you COULD do it in VB6.:
sr.WriteLine("")

Note: the $ at the end of CHR is no longer necessary - hasn't been needed since QuickBasic evolved into VB. It may still work, but it's not needed.

2006-07-16 07:07:00 · answer #1 · answered by lwcomputing 6 · 5 1

Use the chr Character for the quote. I only don't know what chr it is something like chr(102)

Helmut

2006-07-16 07:08:03 · answer #2 · answered by hswes 2 · 0 0

The backslash character tells the compiler that, despite character comes next, relieves it of its widely used objective. as an occasion, '0', capacity that the 0 isn't a '0' character, yet rather the null-terminating character. 'n' capacity new line, rather than the conventional 'n', and '"' capacity that the character '"' does not terminate the string, yet rather is a character in the string. the comparable is going with '''. or perhaps the backslash itself- ''.

2016-10-07 23:50:12 · answer #3 · answered by Anonymous · 0 0

Use Chr
"some text" & Chr$(34) & "more text" & Chr$(34)

2006-07-16 07:05:49 · answer #4 · answered by steppenwolfe_2000 2 · 0 0

fedest.com, questions and answers