G
Guest
Hello,
I've eliminated the bulk of code, this should be sufficient:
byte[] fromEncrypt;
string sDecryptedString;
//Read the data out of the crypto stream.
csDecrypt.Read(fromEncrypt, 0, fromEncrypt.Length);
//At this point in the debugger, I can see there are "trailing" NULLs '\0'
in several of the last fromEncrypt array elements
//Convert the byte array back into a string.
sDecryptedString = textConverter.GetString(fromEncrypt);
I can see ‘\0’ in a number of the array elements of fromEncrypt (at the end
of the array). When I put that into the sDecryptedString, the nulls are
still there.
Other than using a “for†loop and parsing each element, is there a single
command that can remove the trailing nulls from either the fromEncrypt or the
sDecryptedString?
..Trim() or .Trim('\0') didn't work.
Thanks!! Jeff
I've eliminated the bulk of code, this should be sufficient:
byte[] fromEncrypt;
string sDecryptedString;
//Read the data out of the crypto stream.
csDecrypt.Read(fromEncrypt, 0, fromEncrypt.Length);
//At this point in the debugger, I can see there are "trailing" NULLs '\0'
in several of the last fromEncrypt array elements
//Convert the byte array back into a string.
sDecryptedString = textConverter.GetString(fromEncrypt);
I can see ‘\0’ in a number of the array elements of fromEncrypt (at the end
of the array). When I put that into the sDecryptedString, the nulls are
still there.
Other than using a “for†loop and parsing each element, is there a single
command that can remove the trailing nulls from either the fromEncrypt or the
sDecryptedString?
..Trim() or .Trim('\0') didn't work.
Thanks!! Jeff