Answers for "how to declare arrays c#"

C#
1

c# inline array initialization

var array = new string[2]; // creates array of length 2, default values
var array = new string[] { "A", "B" }; // creates populated array of length 2
string[] array = { "A" , "B" }; // creates populated array of length 2
var array = new[] { "A", "B" }; // created populated array of length 2
Posted by: Guest on November-30-2020

C# Answers by Framework

Browse Popular Code Answers by Language