public static IEnumerable> ForeachForIndex (IEnumerable source){ for (int i = 0; i < source.Count(); i++) { var souTemp = source.ElementAt(i); yield return new Tuple (i, souTemp); }}
本文共 345 字,大约阅读时间需要 1 分钟。
public static IEnumerable> ForeachForIndex (IEnumerable source){ for (int i = 0; i < source.Count(); i++) { var souTemp = source.ElementAt(i); yield return new Tuple (i, souTemp); }}
转载于:https://my.oschina.net/raddleoj/blog/852908