Browse by Topic
Popular
Popular Posts
Latest
Latest C# Posts
C# Array to List: Conversion Methods and Performance
Learn how to convert a C# array to a List with ToList() or the List<T> constructor, including performance, memory, and common pitfalls.
C# List to Array: Converting Collections with ToArray()
Convert a List<T> to an array in C# with ToArray() or CopyTo(), and understand the type, performance, and memory implications of each approach.
C# List Count vs Capacity: Key Differences
Understand the difference between Count and Capacity in C# List<T>, and see how setting Capacity can affect memory usage and performance.
C# List Count: Count Property vs Count() Method
Compare the List<T>.Count property and the LINQ Count() method: how they behave on List<T>, performance traits, and when to use Count() over Count.
C# List foreach: Syntax, Pitfalls, and Performance
Learn how to use foreach with List<T> in C#, including syntax, enumerator behavior, common pitfalls, and performance tradeoffs.
How to Reverse a List in C#: In-Place and LINQ
Reverse a C# List<T> with List.Reverse() or LINQ's Reverse(). Compare in-place mutation, deferred enumeration, and practical tradeoffs.
C# List Sort: List.Sort vs LINQ OrderBy
Learn how to sort a List<T> in C# using List.Sort and LINQ OrderBy, including custom comparers, multiple-key sorting, and performance tradeoffs.
C# List Exists: How to Check for Elements
Learn how to check whether an item exists in a C# List using Contains, Exists, and LINQ Any, including equality and performance behavior.
C# List FindIndex: Locating Elements by Predicate
Learn how to use `List<T>.FindIndex` in C# to locate the first element matching a predicate, handle `-1` when nothing matches, and choose among `FindIndex`, `IndexOf`, and LINQ.
Using C# List FindAll to Filter Collections
Learn how to filter a List<T> with FindAll and Predicate<T> in C#, including syntax, examples, and how it compares with LINQ Where.