所以我有两个填充的字符串,但现在我希望它们显示并且 Trim() 似乎不想这样做。
String devicename = "".PadRight(100);
String deviceversion = "".PadRight(100);
bool isDeviceReady = capGetDriverDescriptionA(i, ref devicename, 100, ref deviceversion, 100);
后来我使用如下字符串:
Messagebox.show("Device Name="+devicename.Trim()+" , Device Version="+deviceversion.Trim());
显示的都是“ Device Name=name of the device
”
想法?