D
Drew
I have been using System.Text.Encoding.Unicode.GetString(byte[],0,72)
to converter a byte array from the registry to a string.
This works, but I end up with a bunch of null characters after
the "good" string data that I need to parse. This is evidenced
by the fact that string.length returns 36 when the actual string
data I need to work with is usually much less.
I tried using String.Trim(null) but this doesn't achieve the desired result.
The only thing I can think of is to convert the string to a char array
and loop through until I hit a null character.
Is there a better way to get rid of the nulls?
If I could just get the actual length of the string that would help.
Thanks,
Drew
to converter a byte array from the registry to a string.
This works, but I end up with a bunch of null characters after
the "good" string data that I need to parse. This is evidenced
by the fact that string.length returns 36 when the actual string
data I need to work with is usually much less.
I tried using String.Trim(null) but this doesn't achieve the desired result.
The only thing I can think of is to convert the string to a char array
and loop through until I hit a null character.
Is there a better way to get rid of the nulls?
If I could just get the actual length of the string that would help.
Thanks,
Drew