A better way how to multiply all the elements in an IEnumerable by 2, except First() and Last()??? MyEnumerable.Count.Select((x,i)=> (i>0 && i<MyEnumerable.Count()-1) ? x*2 : x);

This page summarizes the projects mentioned and recommended in the original post on reddit.com/r/csharp

Our great sponsors
  • SonarLint - Deliver Cleaner and Safer Code - Right in Your IDE of Choice!
  • Scout APM - Less time debugging, more time building
  • OPS - Build and Run Open Source Unikernels
  • .NET Runtime

    .NET is a cross-platform runtime for cloud, mobile, desktop, and IoT apps.

    If using Net6, TryGetNonEnumeratedCount is a good way to at least attempt grabbing the count without forcing a total enumeration. https://github.com/dotnet/runtime/issues/27183

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts