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 :: dotnet get directory of executable 
Csharp :: usermanager change password without current password 
Csharp :: unity textmeshpro 
Csharp :: writeline c# 
Csharp :: c# wait seconds 
Csharp :: c# convert dictionary to anonymous object 
Csharp :: unity get speed of object 
Csharp :: c# output double with precision 
Csharp :: unity pause animator 
Csharp :: c# list string initialize inline 
Csharp :: c# unzip files 
Csharp :: button color uwp c# 
Csharp :: unity scriptable object 
Csharp :: change textbox location C# 
Csharp :: c# how to add newline on text box 
Csharp :: wpf choose file dialog 
Csharp :: c# right click event 
Csharp :: unity object follow mouse 
Csharp :: unity array to list 
Csharp :: wpf label text color rgb string 
Csharp :: unity c# set list to set active true 
Csharp :: Set value into lookup field in console app using dynamic CRM 365 
Csharp :: game object disapear after transform.position 
Csharp :: vs code explorer font size 
Csharp :: snx turn off linux 
Csharp :: how to change the position of a gameobject in c# unity 
Csharp :: hello in c# 
Csharp :: set decimal point c# 
Csharp :: clear array c# 
Csharp :: unity get selected gameobject 
ADD CONTENT
Topic
Content
Source link
Name
4+1 =