Answers for "for looping trough array c#"

C#
1

how to loop over array in c#

int[] numbers = new int[] {66,87,34,23,27,4};
foreach(int x in numbers){
	Console.WriteLine(x);
}
Posted by: Guest on October-30-2021
1

c# loop string array

//Using Linq to itterate over an array
var strArr = new string[4] {"one", "Two", "Three", "Four"};
Console.WriteLine(strArr.Select((s, i) => $"Item no: {i + 1}, Value: {s}"));
Posted by: Guest on April-17-2020

C# Answers by Framework

Browse Popular Code Answers by Language