NotSoSmartGuy Posted May 9, 2010 Share Posted May 9, 2010 I want to write to a file EXACTLY "HELLO" Console.WriteLine(" "Hello" ") se the problem with the "'s. How do i get around this Link to comment Share on other sites More sharing options...
0 code_ninja Posted May 9, 2010 Share Posted May 9, 2010 :blink: Link to comment Share on other sites More sharing options...
0 Andre S. Veteran Posted May 9, 2010 Veteran Share Posted May 9, 2010 @dramonai: that doesn't work in VB. For double-quotes, you write double-double quotes: Console.WriteLine("""Hello!""") EDIT: alternatively: Console.WriteLine(ControlChars.Quote + "Hello" + ControlChars.Quote) Link to comment Share on other sites More sharing options...
0 NotSoSmartGuy Posted May 9, 2010 Author Share Posted May 9, 2010 hmmm not getting that to work Link to comment Share on other sites More sharing options...
0 AnthonySterling Posted May 9, 2010 Share Posted May 9, 2010 What is going on with the multiple quotes? :p Console.WriteLine("HELLO") This won't however, write to a file. Link to comment Share on other sites More sharing options...
0 Andre S. Veteran Posted May 9, 2010 Veteran Share Posted May 9, 2010 What is going on with the multiple quotes? :pI think he wants to know how to print the quotes themselves. Link to comment Share on other sites More sharing options...
0 NotSoSmartGuy Posted May 9, 2010 Author Share Posted May 9, 2010 got it ty Link to comment Share on other sites More sharing options...
0 Dav-id Posted May 9, 2010 Share Posted May 9, 2010 can you use escape characters in VB.NET? Console.WriteLine("\"Hello\"") Link to comment Share on other sites More sharing options...
0 Andre S. Veteran Posted May 9, 2010 Veteran Share Posted May 9, 2010 can you use escape characters in VB.NET? Console.WriteLine("\"Hello\"") No. Escape characters are members of ControlChars in VB as I illustrated. Link to comment Share on other sites More sharing options...
Question
NotSoSmartGuy
I want to write to a file EXACTLY "HELLO"
Console.WriteLine(" "Hello" ")
se the problem with the "'s. How do i get around this
Link to comment
Share on other sites
8 answers to this question
Recommended Posts