Horje
get both item and index in c# Code Example
get both item and index in c#
// add this to your namespace
public static IEnumerable<(T item, int index)> WithIndex<T>(this IEnumerable<T> source)
{
    return source.Select((item, index) => (item, index));
}

//do something like this

foreach (var (item, index) in collection.WithIndex())
{
    DoSomething(item, index);
}




Csharp

Related
convert number of days into months c# Code Example convert number of days into months c# Code Example
Wpf Arrow Button Code Example Wpf Arrow Button Code Example
streamwriter c# Code Example streamwriter c# Code Example
c# random number between 0 and 1 Code Example c# random number between 0 and 1 Code Example
int to bool c# Code Example int to bool c# Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
11