Problem : I have a list as follows: {CT, MA, VA, NY} I submit this list to a function and […]
Tag: list
How does C# dynamically allocate memory for a List?
Problem : From LukeH’s answer to what is the max limit of data into list<string> in c#? The maximum number […]
How to get a list of week days in a month?
Problem : In this other question it shows how to get all days of a month. I need the same […]
List.Contains() is very slow?
Problem : Could anyone explain me why the generics List.Contains() function is so slow? I have a List<long> with about […]
How to convert an ArrayList to a strongly typed generic list without using a foreach?
Problem : See the code sample below. I need the ArrayList to be a generic List. I don’t want to […]
Why does enumerating through a collection throw an exception but looping through its items does not
Problem : I was testing out some synchronization constructs and I noticed something that confused me. When I was enumerating […]
Find item in IList with LINQ
Problem : I have an IList: IList list = CallMyMethodToGetIList(); that I don’t know the type I can get it […]
Sorting a List in C# using List.Sort(Comparison comparison
Problem : I have created a class as follows: public class StringMatch { public int line_num; public int num_of_words; } […]
Can you remove an item from a List<> whilst iterating through it in C#
Problem : Can you remove an item from a List<> whilst iterating through it? Will this work, or is there […]
Export a C# List of Lists to Excel
Problem : Using C#, is there a direct way to export a List of Lists (i.e., List<List<T>>) to Excel 2003? […]