Results 1 to 7 of 7

Thread: [RESOLVED] [2005] Concating strings

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jun 2007
    Posts
    66

    Resolved [RESOLVED] [2005] Concating strings

    I don't know why but for some reason VB refuses to concat anything at the end of a variable.

    Code:
        Public Function bTag(ByVal bTaggedItem() As Byte, ByVal sTag As String) As Byte()
        Dim sTaggedItem As String = getString(bTaggedItem)
        Dim bReturn() As Byte = getBytes("<!" & sTag & ">" & sTaggedItem & "</" & sTag & ">")
        Return bReturn
        End Function

    No matter what I do VB refuses to perform this part of the above function:

    sTaggedItem & "</" & sTag & ">"

    It shows up with the content of the string sTaggedItem with nothing at the end. I've tried everything I can think of, is there a reason this doesn't work?

  2. #2
    Code Monkey wild_bill's Avatar
    Join Date
    Mar 2005
    Location
    Montana
    Posts
    2,993

    Re: [2005] Concating strings

    Does sTaggedItem have null (hex value 00) data in it? I've had problems with that. Usually, I'll do something like
    vb Code:
    1. sTaggedItem.Replace(Convert.ToChar(0),"")

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Jun 2007
    Posts
    66

    Re: [2005] Concating strings

    It is possible that it could be null but in the test runs I've performed it was a string about 20 characters in length.

  4. #4
    Code Monkey wild_bill's Avatar
    Join Date
    Mar 2005
    Location
    Montana
    Posts
    2,993

    Re: [2005] Concating strings

    I just want to clarify that I'm not refering to a null string object, but a string object with null characters in it.

  5. #5
    Addicted Member
    Join Date
    Sep 2007
    Location
    Right behind you
    Posts
    170

    Re: [2005] Concating strings

    can you tell us what the input variables have when your program access that funtion?

  6. #6

    Thread Starter
    Lively Member
    Join Date
    Jun 2007
    Posts
    66

    Re: [2005] Concating strings

    Wild_bill I didn't understand you at first but now I get it, and your right. There was a null character at the end. What causes that? Is there anyway to avoid that happening?

  7. #7
    Code Monkey wild_bill's Avatar
    Join Date
    Mar 2005
    Location
    Montana
    Posts
    2,993

    Re: [2005] Concating strings

    I'm not sure what systems do that. When ever I've ran into it, it has been a file from a client.

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