Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

c# initialize dictionary

Dictionary<int, string> dictNew = new Dictionary<int,string>()
{
  {1, "true"},
  {2, "false"}
}
Comment

c# dictionary initializer

var dictionary = new Dictionary<string, string>
{
     { "LAX", "Los Angeles International Airport" },
     { "MEL", "Melbourne Tullamarine Airport" }
};

//C# 6 introduces a new index-like syntax to initialize dictionaries: 
var dictionary = new Dictionary<string, string>
{
     ["LAX"] = "Los Angeles International Airport",
     ["MEL"] = "Melbourne Tullamarine Airport"
};
Comment

PREVIOUS NEXT
Code Example
Csharp :: c# dictionary loop key value 
Csharp :: make folder with c# 
Csharp :: c# size of enum 
Csharp :: copy text from a text box c# 
Csharp :: c# console foreground color 
Csharp :: 2d topdown movement unity 
Csharp :: c# declare an int list 
Csharp :: how to say hello world in c# 
Csharp :: c# do while loop 
Csharp :: c# remove duplicates from datatable 
Csharp :: convert string into double in c# 
Csharp :: how to print using C# 
Csharp :: list removeall unity 
Csharp :: how to add a queue unity 
Csharp :: dotnet build command 
Csharp :: c# list with 0 initialize 
Csharp :: c# bitmap to byte array 
Csharp :: difference two list c# 
Csharp :: c# switch unity 
Csharp :: c# create list with range 
Csharp :: how to check if file contains image c# 
Csharp :: unity cap fps 
Csharp :: c# named parameters 
Csharp :: how to import datagridview to datatable in c# 
Csharp :: c# sort array of objects 
Csharp :: how to look around with mouse in unity 
Csharp :: c# string code ascii 
Csharp :: relative path c# 
Csharp :: c# remove first line from textbox 
Csharp :: get file extension in c# file upload 
ADD CONTENT
Topic
Content
Source link
Name
4+3 =