Results 1 to 4 of 4

Thread: [RESOLVED] Quotes

  1. #1

    Thread Starter
    New Member
    Join Date
    Nov 2016
    Posts
    8

    Resolved [RESOLVED] Quotes

    In a combobox, have a list of 3 options. They are measurements like 2-1/16", 2-5/8", 3"

    If my code, I am trying to say,

    If combobox.selecteditem = "2-1/16"" Then.....

    How can I allow the single " to represent inches? TIA

    Jeff

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,344

    Re: Quotes

    You escape a literal quote with another quote, e.g.
    vb.net Code:
    1. Dim str = "2-1/16"""

  3. #3
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,344

    Re: Quotes

    In some situations, it is preferable to use ControlChars.Quote, e.g.
    vb.net Code:
    1. Dim str = $"2-1/16{ControlChars.Quote}"
    In this case though, I'd used the escaped literal.

  4. #4

    Thread Starter
    New Member
    Join Date
    Nov 2016
    Posts
    8

    Re: Quotes

    Awesome - thank you!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width