You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
450 B
17 lines
450 B
namespace StabilityMatrix.Core.Extensions; |
|
|
|
public static class EnumerableExtensions |
|
{ |
|
public static IEnumerable<(int, T)> Enumerate<T>( |
|
this IEnumerable<T> items, |
|
int start |
|
) { |
|
return items.Select((item, index) => (index + start, item)); |
|
} |
|
|
|
public static IEnumerable<(int, T)> Enumerate<T>( |
|
this IEnumerable<T> items |
|
) { |
|
return items.Select((item, index) => (index, item)); |
|
} |
|
}
|
|
|