我有以下字符串:\\\?\hid#vid_04d8pid_003f#62edf110800000#{4d1e55b2-f16f-11cf-88cb-001111000030}
存储在字符串变量(从一个函数调用)称为devPathName
为什么string.contains()返回false?
和下列定义:const string myDevice = @"vid_04d8pid_003f";
但下面的代码总是评估为假:
Boolean test = true;
test = devPathName.Contains(myDevice);
statusLabel.Text += "\n\tThe value of test: " + test.ToString();
它在我的机器上返回true。您可能想要提供有关该代码上下文以及如何测试的更多信息。 – 2009-06-29 03:25:41