相关疑难解决方法(0)

c#按字母顺序按列对列表进行排序

我定义了一个类,并将该类的记录写入列表。在编写错误报告之前无法对列表进行排序。我试图在编写错误报告之前按“finderror”类型的字母顺序对列表进行排序,以便在错误报告中对列表进行排序和更有条理。这是课程:

public class types
{
    public types() { }
    public string person { get; set; }
    public string state { get; set; }
    public string phone# { get; set; }
    public string finderror { get; set; }

}
Run Code Online (Sandbox Code Playgroud)

如果我写这个,我会收到以下错误:

    List1 = List1.Sort();
    List1 is a global list I declared before my main.

    Error-Cannot implicitly convert type 'void' to 'System.Collections.Generic.List<types>'
Run Code Online (Sandbox Code Playgroud)

我如何按字母顺序按列表中的“finderror”列排序。

c# sorting collections

1
推荐指数
1
解决办法
1256
查看次数

标签 统计

c# ×1

collections ×1

sorting ×1