Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

c# dictionary values to list

var items = myDictionary.Values.ToList();

//Use Linq if you want to flattern your lists
var items = myDictionary.SelectMany (d => d.Value).ToList();
Comment

dictionary to list c#

Dictionary<string, string> dicNumber = new Dictionary<string, string>();
List<string> listNumber = new List<string>();

dicNumber.Add("1", "First");
dicNumber.Add("2", "Second");
dicNumber.Add("3", "Third");

listNumber = dicNumber.Select(kvp => kvp.Key).ToList();
// Or:
listNumber = dicNumber.Keys.ToList();
Comment

dictionary to list c#

var keys = new List<string>(dicNumber.Keys);
Comment

PREVIOUS NEXT
Code Example
Csharp :: array join c# 
Csharp :: billboard canvas unity 
Csharp :: .net core check if linux 
Csharp :: c# round double 
Csharp :: windows form textbox password 
Csharp :: fluent assertions exception 
Csharp :: Gameobject.Find in unityC# 
Csharp :: c# add object to array 
Csharp :: c# execute shell command 
Csharp :: raycasthit unity 
Csharp :: Entity Framework Core 3.1 Return value (int) from stored procedure 
Csharp :: 2d list c# 
Csharp :: show snackbar without scaffold flutter 
Csharp :: checking if character is a digit or not in c# 
Csharp :: aspx import namespace 
Csharp :: check two lists are equal c# 
Csharp :: how to get keyboard input in unity 
Csharp :: c# binding add combobox with enum values 
Csharp :: c# calculate sum of list 
Csharp :: c# get type of class 
Csharp :: how to remove all whitespace from a string in c# 
Csharp :: c# combobox add item 
Csharp :: c# convert enumb to int array 
Csharp :: get selected item datagrid wpf 
Csharp :: how to add to a list only items that are not already in the list c# 
Csharp :: c# implement ienumerable t 
Csharp :: Get enum value from string or int 
Csharp :: c# func 
Csharp :: asp.net format datetime 
Csharp :: c# substring until character single 
ADD CONTENT
Topic
Content
Source link
Name
7+1 =