|
-
Oct 4th, 2007, 11:25 AM
#1
Thread Starter
Lively Member
[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?
-
Oct 4th, 2007, 12:29 PM
#2
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),"")
-
Oct 4th, 2007, 12:36 PM
#3
Thread Starter
Lively Member
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.
-
Oct 4th, 2007, 02:41 PM
#4
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.
-
Oct 4th, 2007, 03:41 PM
#5
Addicted Member
Re: [2005] Concating strings
can you tell us what the input variables have when your program access that funtion?
-
Oct 4th, 2007, 03:54 PM
#6
Thread Starter
Lively Member
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?
-
Oct 4th, 2007, 04:19 PM
#7
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|