定义public SortedList<int ,string> LyricList = new SortedList<int,string>();
往其中添加数据后,怎么知道里面有没有某个特定的键
如: LyricList.Add(1,"cat");
之后怎么判断LyricList里有没有包含1;
往其中添加数据后,怎么知道里面有没有某个特定的键
如: LyricList.Add(1,"cat");
之后怎么判断LyricList里有没有包含1;
SortedList<int ,string> LyricList = new SortedList<int,string>();
LyricList.Add(1, "cat");
if (LyricList.ContainsKey(1))
{
Console.WriteLine("LyricList里包含1");
}