tagged [list]

Casting IEnumerable<T> to List<T>

Casting IEnumerable to List I was wondering if it is possible to cast an `IEnumerable` to a `List`. Is there any way to do it other than copying out each item into a list?

25 Nov at 20:56

How do I get the number of elements in a list (length of a list) in Python?

How do I get the number of elements in a list (length of a list) in Python? How do I get the number of elements in the list `items`?

13 Oct at 18:5

Create a dictionary with comprehension

Create a dictionary with comprehension Can I use list comprehension syntax to create a dictionary? For example, by iterating over pairs of keys and values:

Convert string to List<string> in one line?

Convert string to List in one line? I have a string: Is there a way to convert this to a `List` delimited by `,` in one line?

16 Feb at 01:8

How to convert a column of DataTable to a List

How to convert a column of DataTable to a List I have a DataTable with multiple columns. I want to get a `List` out of first column of DataTable. How can I do that?

8 Jul at 03:8

Is there a concurrent List in Java's JDK?

Is there a concurrent List in Java's JDK? How can I create a concurrent List instance, where I can access elements by index? Does the JDK have any classes or factory methods I can use?

15 Feb at 22:55

Convert list of objects to string in one line

Convert list of objects to string in one line I have a list of objects that implement `ToString()`. I need to convert the whole list to one string in one line. How can I do that?

2 Jan at 17:29

Bool list check if every item in list is false

Bool list check if every item in list is false I have a `List` with lots of values. What is the most efficient way to check if every single item in the list equals `false`?

24 Mar at 19:1

Merge two List<object> into one List in Linq

Merge two List into one List in Linq I have two lists. `BeamElevations` and `FloorElevations`. How can I merge these into `Elevations` list and order them based on their Elevation using Linq?

11 Apr at 15:29

What is better, adjacency lists or adjacency matrices for graph problems in C++?

What is better, adjacency lists or adjacency matrices for graph problems in C++? What is better, adjacency lists or adjacency matrix, for graph problems in C++? What are the advantages and disadvantag...

Get Max value from List<myType>

Get Max value from List I have List `List`, my type contains `Age` and `RandomID` Now I want to find the maximum age from this list. What is the simplest and most efficient way?

18 Jan at 10:44

C# List<string> to string with delimiter

C# List to string with delimiter Is there a function in C# to quickly convert some collection to string and separate values with delimiter? For example: `List names` --> `string names_together = "John...

6 Nov at 12:42

Convert a list to a string in C#

Convert a list to a string in C# How do I convert a list to a string in C#? When I execute `toString` on a List object, I get: > System.Collections.Generic.List`1[System.String]

10 Dec at 13:0

Python for-in loop preceded by a variable

Python for-in loop preceded by a variable I saw some code like: What does this mean, and how does it work?

How do I check in python if an element of a list is empty?

How do I check in python if an element of a list is empty? I have a list like How do I check if l[i] is empty? and dont't work.

7 Dec at 07:39

Storing 2 columns into a List

Storing 2 columns into a List How can I store data from 2 columns (from a database) in a List Any help is appreciated

How to store list of object into ViewState

How to store list of object into ViewState I have a list of type `List`. I want to store it in ViewState. How this can be done?

26 Mar at 15:23

How to convert List<T> to HashSet<T> in C#?

How to convert List to HashSet in C#? I have a List that has duplicates of objects. To solve that, I need to convert the List into a HashSet (in C#). Does anyone know how?

25 Jun at 14:16

Efficiency of List<T>.IndexOf() versus List<T>.FindIndex()

Efficiency of List.IndexOf() versus List.FindIndex() Which one of the methods - `List.IndexOf()`- `List.FindIndex()` is more efficient in terms of processing time? The type of `T` in this instance is ...

11 Jul at 01:8

Check of two list have colliding element?

Check of two list have colliding element? Is there a way to check if one list collides with another? ex:

10 Sep at 06:54

java - iterating a linked list

java - iterating a linked list if I use a for-each loop on a linked list in java, is it guaranteed that I will iterate on the elements in the order in which they appear in the list?

22 Jan at 11:44

Is the order of elements in a JSON list preserved?

Is the order of elements in a JSON list preserved? I've noticed the order of elements in a JSON object not being the original order. What about the elements of JSON lists? Is their order maintained?

24 Jan at 13:23

How can I list (ls) the 5 last modified files in a directory?

How can I list (ls) the 5 last modified files in a directory? I know `ls -t` will list all files by modified time. But how can I limit these results to only the last files?

28 Mar at 20:17

Sort a list of objects in Flutter (Dart) by property value

Sort a list of objects in Flutter (Dart) by property value How to sort a list of objects by the alphabetical order of one of its properties (Not the name but the actual value the property holds)?

8 Dec at 02:22

How to check if element in groovy array/hash/collection/list?

How to check if element in groovy array/hash/collection/list? How do I figure out if an array contains an element? I thought there might be something like `[1, 2, 3].includes(1)` which would evaluate ...

4 Apr at 05:24