[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?
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:
sTaggedItem.Replace(Convert.ToChar(0),"")
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.
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.
Re: [2005] Concating strings
can you tell us what the input variables have when your program access that funtion?
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?
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.