About 35,300,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. .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 …

  3. 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 …

  4. 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...

  5. c# - ToList () - does it create a new list? - Stack Overflow

    May 5, 2010 · 282 Yes, ToList will create a new list, but because in this case MyObject is a reference type then the new list will contain references to the same objects as the original list. Updating the …

  6. 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

  7. 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 …

  8. 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.

  9. c# - How to Sort a List<T> by a property in the object - Stack Overflow

    Jul 22, 2010 · List<Order> objListOrder = new List<Order>(); GetOrderList(objListOrder); // fill list of orders I want to sort the list based on one property of the Order object; for example, either by …

  10. c# - Getting a list item by index - Stack Overflow

    I've recently started using c# moving over from Java. I can't seem to find how to get a list item by index. In java to get the first item of the list it would be: list1.get (0); What is the equival...