我是C#的初学者,看了很多帖子但仍然感到困惑。
我有一个数组列表:
List<Array> moves = new List<Array>();
我正在使用以下方法为其添加动作:
string[] newmove = { piece, axis.ToString(), direction.ToString() };
moves.Add(newmove);
现在我想使用以下方法去除重复项:
moves = moves.Distinct();
然而我无法这样做。我收到了以下错误:
无法隐式将类型 'System.Collections.Generic.IEnumerable' 转换为 'System.Collections.Generic.List'。存在显式转换(是否缺少强制转换?)
请帮帮我好吗?非常感谢。
Steve