So I have two string that were padded, but now I want them show and Trim() doesn’t seem to want to do it.
String devicename = "".PadRight(100);
String deviceversion = "".PadRight(100);
bool isDeviceReady = capGetDriverDescriptionA(i, ref devicename, 100, ref deviceversion, 100);
later I use the strings like in the below:
Messagebox.show("Device Name="+devicename.Trim()+" , Device Version="+deviceversion.Trim());
All that is shown is “Device Name=name of the device“
Thoughts?
In the end it was pretty simple. Tomas Petrick was on the right track. It, the string, returned was a null terminated (also called a zero-terminated) string. Then I just needed to remove the null terminator from the strings.