Enumerable.Index<TSource>(IEnumerable<TSource>) 方法

定义

返回一个可枚举值,该枚举将元素的索引合并到元组中。

C#
public static System.Collections.Generic.IEnumerable<(int Index, TSource Item)> Index<TSource> (this System.Collections.Generic.IEnumerable<TSource> source);

类型参数

TSource

source的元素的类型。

参数

source
IEnumerable<TSource>

提供元素的源可枚举。

返回

例外

source null

适用于

产品 版本
.NET 9