loop through multidimensional array c#
for (int x = 0; x < YourArray.GetLength(0); x++)
{
for (int y = 0; y < YourArray.GetLength(1); y++)
{
Console.WriteLine(YourArray[x, y]);
}
}
loop through multidimensional array c#
for (int x = 0; x < YourArray.GetLength(0); x++)
{
for (int y = 0; y < YourArray.GetLength(1); y++)
{
Console.WriteLine(YourArray[x, y]);
}
}
foreach two arrays c#
var numbers = new [] { 1, 2, 3, 4 };
var words = new [] { "one", "two", "three", "four" };
var numbersAndWords = numbers.Zip(words, (n, w) => new { Number = n, Word = w });
foreach(var nw in numbersAndWords)
{
Console.WriteLine(nw.Number + nw.Word);
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us