gpt4 book ai didi

c# - 比较两个字符串[]

转载 作者:行者123 更新时间:2023-11-30 13:20:36 25 4
gpt4 key购买 nike

<分区>

在这里给我一个错误:

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";
}

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com