About 26,100,000 results
Open links in new tab
  1. Quick way to create a list of values in C#? - Stack Overflow

    I'm looking for a quick way to create a list of values in C#. In Java I frequently use the snippet below:

  2. Define a List of Objects in C# - Stack Overflow

    Define a List of Objects in C# Asked 10 years, 11 months ago Modified 4 years ago Viewed 133k times

  3. .net - Creating a List of Lists in C# - Stack Overflow

    Feb 25, 2015 · Edit: Adding information Would declaring a List<List<T>> be considered legal here? In case you are wondering, I am building a class that allows me to use a ulong as the indexer, and …

  4. c# - How can I find a specific element in a List<T>? - Stack Overflow

    The example above works, because in C# an assignment can be used as an expression or as a statement. The value of an assignment expression is the assigned value where the assignment itself …

  5. Most efficient way to find if a value exists within a C# List

    Apr 17, 2013 · In C# if I have a List of type bool. What is the fastest way to determine if the list contains a true value? I don’t need to know how many or where the true value is. I just need to know if one e...

  6. c# - Find an item in a list by LINQ - Stack Overflow

    string search = "lookforme"; List<string> myList = new List<string>(); string result = myList.Single(s => s == search); Note that SingleOrDefault() will behave the same, except it will return null for reference …

  7. How can I initialize a C# List in the same line I declare it ...

    Dec 14, 2010 · 7 Posting this answer for folks wanting to initialize list with POCOs and also coz this is the first thing that pops up in search but all answers only for list of type string. You can do this two …

  8. c# - string.Join on a List<int> or other type - Stack Overflow

    Aug 31, 2010 · string.Join on a List<int> or other type Asked 15 years, 3 months ago Modified 2 years, 7 months ago Viewed 141k times

  9. c# - How to initialize a list with constructor? - Stack Overflow

    Feb 1, 2012 · Please guide me is among best practices to use constructor with for list initialization? How to assign values to list using a constructor, so if no value passed a default will be used?

  10. C# list.Orderby descending - Stack Overflow

    I would like to receive a List sorted by Product.Name in descending order. Similar to the function below which sorts the list in ascending order, just in reverse, is this possible? var newList = list.