• 0

simple vb.net question


Question

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

  • 0

@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

  • 0

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

  • 0

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

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.