B
buc
I have created a byte array (1000 in size) to recv a network packet. I recv
the packet, which varies in size, and need to put the packet in a string; so
I can append another string after the packet string. The problem is the
packet string apparently has nulls or something in the unused space up to
1000. and of course when I append a string AFTER the packet string it
doesn't display.How can I stick a b yte array into a string removing the
random number of nulls at the end. I tried to get the len of the packet
string and copy it, but it always returns 1000 regardless of the packet
size. I've tried different variations of
Encoding.ASCII.GetString(RecvBytes).ToString
but that copies the nulls too, and creates a new string of len 1000, with
the first x number of chars actually having valid data in it..
Thanks ...
BUC
the packet, which varies in size, and need to put the packet in a string; so
I can append another string after the packet string. The problem is the
packet string apparently has nulls or something in the unused space up to
1000. and of course when I append a string AFTER the packet string it
doesn't display.How can I stick a b yte array into a string removing the
random number of nulls at the end. I tried to get the len of the packet
string and copy it, but it always returns 1000 regardless of the packet
size. I've tried different variations of
Encoding.ASCII.GetString(RecvBytes).ToString
but that copies the nulls too, and creates a new string of len 1000, with
the first x number of chars actually having valid data in it..
Thanks ...
BUC