Answers for "c# array of strings"

C#
29

c# initialize array

string[] stringArray = new string[6];
//or
int[] array1 = new int[] { 1, 3, 5, 7, 9 };
//
string[] weekDays = new string[] { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" };
//etc
Posted by: Guest on April-02-2020
67

c# array

int[] array = new int[]{1, 2, 3, 4, 5};
foreach (string i in array) 
{
  Console.WriteLine(i);
}

//or

for(int i=0; i<array.Length; i++){
	  Console.WriteLine(array[i]);
}
Posted by: Guest on February-20-2020
0

c# array of strings

string[] img_urls = new string[] {
                "/images/cherry.jpg",
                "/images/shamrock.jpg",
                "/images/horseshoe.jpg"
            };
Posted by: Guest on September-08-2021
1

how to make an array in csharp

// whatever type you want
public GameObject[] Players;
Posted by: Guest on June-06-2020

C# Answers by Framework

Browse Popular Code Answers by Language