Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/263.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/typo3/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 排序列表<;列表<;字符串>&燃气轮机;按长度升序排列_C# - Fatal编程技术网

C# 排序列表<;列表<;字符串>&燃气轮机;按长度升序排列

C# 排序列表<;列表<;字符串>&燃气轮机;按长度升序排列,c#,C#,我可以知道如何按列表的长度按升序对列表进行排序吗?var result=List.OrderBy(x=>x.length)x.Length); 如果您认为这个问题对您有帮助,请帮助我回答-2:) IEnumerable<List<string>> result = listOfListOfStrings.OrderBy(x => x.Length);

我可以知道如何按
列表的长度按升序对
列表进行排序吗?

var result=List.OrderBy(x=>x.length)
<

或者,您可以从列表中创建IEnumerable,该列表在枚举时按排序顺序返回列表,但保留原始列表不变:

IEnumerable<List<string>> result = listOfListOfStrings.OrderBy(x => x.Length);
IEnumerable result=listofListofString.OrderBy(x=>x.Length);

如果您认为这个问题对您有帮助,请帮助我回答-2:)
IEnumerable<List<string>> result = listOfListOfStrings.OrderBy(x => x.Length);