如何列出清单

本文关键字:何列出 | 更新日期: 2023-09-27 18:05:22

我试着做一些像英语拼写/语法检查程序。我不知道如何为正确的建议选项写列表。http://www.polishmywriting.com/例子:

错误:1 suggestion1suggestion2suggestion3

错误:2 suggestion1suggesiton2suggestion3

错误:

3 suggestion1suggesiton2

等取决于你得到的错误数。

你知道我该怎么写吗?

如何列出清单

你可以使用下面的代码在c#中创建列表的列表

List<List<string>> myList = new List<List<string>>();
myList.Add(new List<string> { "a", "b" });
myList.Add(new List<string> { "c", "d", "e" });
myList.Add(new List<string> { "qwerty", "asdf", "zxcv" });
myList.Add(new List<string> { "a", "b" });
// To iterate over it.
foreach (List<string> subList in myList)
{
    foreach (string item in subList)
    {
        Console.WriteLine(item);
    }
}