CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: Quotes

  1. #1
    Join Date
    Aug 2000
    Location
    San Clemente CA
    Posts
    16

    Quotes

    I would like to put quotes into a string. Example is I would like lets say
    strMine = "Text1.text"
    Result would be if Text1.text was ... some text
    then strMine would equal "some text" qutoes and all
    Thanks so much I know this is very easy but thank you advance for the time and help!



  2. #2
    Join Date
    Jul 2000
    Location
    Milano, Italy
    Posts
    7,726

    Re: Quotes

    double quotes:
    text1.text = ""text""
    or use single quote ' doubled:
    text1.text = "''text''"
    or :
    Text1.text = """ & "text" & """


    Special thanks to Lothar "the Great" Haensler, Tom Archer, Chris Eastwood, Bruno Paris and all the other wonderful people who made and make Codeguru a great place. Come back soon, you Gurus.
    ...at present time, using mainly Net 4.0, Vs 2010



    Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
    all the other wonderful people who made and make Codeguru a great place.
    Come back soon, you Gurus.

  3. #3
    Join Date
    Jan 2000
    Location
    Olen, Belgium
    Posts
    2,477

    Re: Quotes

    Hate to bother you Cimp, but you made some mayor mistakes there with the examples:

    text1.text = ""text""
    ' gives an error, should be
    text1.text = """text"""

    text1.text = "''text''"
    ' nice workaround

    text1.text = """ & "text" & """
    ' gives and error, should be
    text1.text = """" & "text & """"
    ' actually, I think the first one is the simpelest




    Tom Cannaerts
    [email protected]

    Programming today is a race between software engineers striving to build bigger and better idot-proof programs, and the universe trying to produce bigger and better idiots. So far, the universe is winning -- Rich Cook
    Tom Cannaerts
    email: [email protected]
    www.tom.be (dutch site)

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

Featured