这里扔我一个错误:比较两个字符串[]
string.Compare(list[], list1[],true); <<<<<<
导致错误。
string[] list = { "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "v", "z" };
string[] list1 = { "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "v", "z" };
int result = string.Compare(list[], list1[], true);
if (result == 0)
{
Label1.Text += "Two strings are equal";
}
else if (result == 1)
{
Label1.Text += "Test String1 is greater than Test String2";
}
else if (result == -1)
{
Label1.Text += "Test String1 is less than Test String2";
}
请仔细阅读本:http://tinyurl.com/so-hints – Oded 2011-06-04 20:21:01
@ Matt Ball,thecoop,Chris,Alex Aza,Oded:哇,所以你们决定关闭?这个问题有什么含糊或模糊的地方? – 2011-06-04 20:53:38