Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21205

How to remove null from fixed length string

$
0
0
There is a fixed length string which has 3 null char.
I want to concatenate other string to this string but failed because 3 nulls.
How can I do this?

Here is sample code.

Dim str1 As String * 10
Dim str2 As String

str1 = "ABCDEFG" & Chr(0) & Chr(0) & Chr(0)
str2 = str1 + "HIJ"

MsgBox str2 'str2 is ""ABCDEFG" not "ABCDEFGHIJ"

Viewing all articles
Browse latest Browse all 21205


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>