CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 7 of 7
  1. #1
    Join Date
    Dec 2002
    Location
    NC
    Posts
    125

    string concantenation

    I'm doing a replace() in a string of text but unfortunately there are two " " with in the text. Well, VB isn't liking that, Is there a trick to concantenate the true "" that are surounding my text?
    R.L.T.W. A+, NET+, CCNA

    doin' my best

  2. #2
    Join Date
    Jul 2001
    Location
    Sunny South Africa
    Posts
    11,284

    Re: string concantenation

    Quote Originally Posted by dedub
    I'm doing a replace() in a string of text but unfortunately there are two " " with in the text. Well, VB isn't liking that, Is there a trick to concantenate the true "" that are surounding my text?
    Use Chr(34) instead of "

    Example:
    Code:
    Text1.Text = Chr(34) & Text2.Text & Text3.Text & Chr(34)
    Last edited by HanneSThEGreaT; October 25th, 2005 at 01:10 AM.

  3. #3
    Join Date
    Dec 2002
    Location
    London, UK
    Posts
    1,569

    Re: string concantenation

    Eh? Sorry? What exaclty are we talking about here? Do you mean you want double quotes? Well, placing two double quotes directly after each other acts as a single double quote character.

    i.e.
    str = """" & Text1 & """"

    Note: """" is four double quotes. One to open the string, two as the double quote character, one to close the string.
    Mike

  4. #4
    Join Date
    Dec 2002
    Location
    NC
    Posts
    125

    Re: string concantenation

    To ********, this is what Im doing...
    Parsing text of a website. Im using the replace to pull out several instances of this line.

    </td><tr bgcolor="#FFFFFF"><td>

    notice the qutoes already in the string, that makes it difficult to concantenate. I have not tried HanneSThEGreaT's suggestion yet but Ill let you know

    Thanks
    R.L.T.W. A+, NET+, CCNA

    doin' my best

  5. #5
    Join Date
    Dec 2002
    Location
    London, UK
    Posts
    1,569

    Re: string concantenation

    No... sorry still don't get what you are trying to do and where your problem lies. Maybe I'm just thick.

    So you have this line.. do you want to get rid of it? If so:

    Replace myString, "</td><tr bgcolor=""#FFFFFF""><td>", ""

    Is that what you mean? If not then please explain what excatly you are trying to do.
    Mike

  6. #6
    Join Date
    Dec 2002
    Location
    NC
    Posts
    125

    Re: string concantenation

    Mike, that is exactly what I wanted to do. After I added the xtra "" it worked like a charm and now Im that much smarter with strings, THANKS!

    Darrin
    R.L.T.W. A+, NET+, CCNA

    doin' my best

  7. #7
    Join Date
    Dec 2002
    Location
    London, UK
    Posts
    1,569

    Re: string concantenation

    no prob. glad you came right
    Mike

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