c# loop through two dimensional array
C#
using System;
using System.Collections.Generic;
using System.Linq;
public class Demo {
public static void Main() {
string[,] array = new string[3, 3];
array[0, 0] = "One";
array[0, 1] = "Two";
array[0, 2] = "Three";
array[1, 0] = "Four";
array[1, 1] = "Five";
array[1, 2] = "Six";
array[2, 0] = "Seven";
array[2, 1] = "Eight";
array[2, 2] = "Nine";
// getting upper bound
int uBound0 = array.GetUpperBound(0);
int uBound1 = array.GetUpperBound(1);
for (int i = 0; i <= uBound0; i++) {
for (int j = 0; j <= uBound1; j++) {
string res = array[i, j];
Console.WriteLine(res);
}
}
Console.ReadLine();
}
}
Also in C#:
- Title
- check version of asp.net core
- Category
- C#
- Title
- Random number unity
- Category
- C#
- Title
- c# stop loop in method
- Category
- C#
- Title
- datagridview column color c#
- Category
- C#
- Title
- c# to vb.net
- Category
- C#
- Title
- how to put double quotes in a string c#
- Category
- C#
- Title
- define a vector c#
- Category
- C#
- Title
- unity c# is not equal to
- Category
- C#
- Title
- Add component object to gameobject unity
- Category
- C#
- Title
- How to search for a string from readline in c#
- Category
- C#
- Title
- c# string code ascii
- Category
- C#
- Title
- getcomponent c#
- Category
- C#
- Title
- max of array C#
- Category
- C#
- Title
- read embedded resource c# xml
- Category
- C#
- Title
- rotate to face direction
- Category
- C#
- Title
- c# main method
- Category
- C#
- Title
- c# windows application get current path
- Category
- C#
- Title
- windows form rounded corners
- Category
- C#
- Title
- lat long data type c#
- Category
- C#
- Title
- unity3d invector expand fsm controller
- Category
- C#
- Title
- string.charat c#
- Category
- C#
- Title
- C# how to expose an internal class to another project in the solution
- Category
- C#
- Title
- how to pass an optional parameter in c# mvc asp.net
- Category
- C#
- Title
- unity array c#
- Category
- C#
- Title
- c# error CS0120
- Category
- C#
- Title
- .net 4.5 use tls 1.2
- Category
- C#
- Title
- C# array to label
- Category
- C#
- Title
- codecademy
- Category
- C#
- Title
- c# list remove item based on property duplicate
- Category
- C#
- Title
- how to create more accurate searching c#
- Category
- C#
- Title
- reload current scene unity
- Category
- C#
- Title
- c# datafield change cell background color
- Category
- C#
- Title
- formula calculating distance coordinates latitude longitude c#
- Category
- C#
- Title
- unity onselect gizmos wireframe
- Category
- C#
- Title
- unity deactive all object in list
- Category
- C#
- Title
- how to reference scripts in other scenes unity
- Category
- C#
- Title
- c# byte array to bitmap
- Category
- C#
- Title
- how to add to an array c#
- Category
- C#
- Title
- c# do loop
- Category
- C#
- Title
- stop unity editor playing
- Category
- C#
- Title
- c# linq order by multiple columns
- Category
- C#
- Title
- c# change material in code
- Category
- C#
- Title
- unity get velocity of gameobject
- Category
- C#
- Title
- usermanager find based on role
- Category
- C#
- Title
- c# convert int to string
- Category
- C#
- Title
- how to set a transform equal to something unity
- Category
- C#
- Title
- .net core session
- Category
- C#
- Title
- C# sprint key
- Category
- C#
- Title
- transform.Translate movement
- Category
- C#
- Title
- toggle unity c#
- Category
- C#
- Title
- c# ref
- Category
- C#
- Title
- singleton design pattern c# volatile
- Category
- C#
- Title
- escape double quotes c#
- Category
- C#
- Title
- serilog loglevel order
- Category
- C#
- Title
- compile in one single exe c#
- Category
- C#
- Title
- c# reverse a string
- Category
- C#
- Title
- move character unity
- Category
- C#
- Title
- textblock line break
- Category
- C#
- Title
- c# get date without time
- Category
- C#
- Title
- dynamic convert type c#
- Category
- C#
- Title
- O thread de chamada não pode aceder a este objecto porque existe outro thread que já o tem
- Category
- C#
- Title
- onmouseover unity
- Category
- C#
- Title
- making pong in unity
- Category
- C#
- Title
- c# fileupload example
- Category
- C#
- Title
- Linq - Random Elements
- Category
- C#
- Title
- Request.Form
- Category
- C#
- Title
- unity quaternion
- Category
- C#
- Title
- c# directories loop
- Category
- C#
- Title
- play sound on collision unity c#
- Category
- C#
- Title
- how to add a gameobject
- Category
- C#
- Title
- out parameters c#
- Category
- C#
- Title
- how to make an array in csharp
- Category
- C#
- Title
- c# list append
- Category
- C#
- Title
- how to make a string a list of characters c#
- Category
- C#
- Title
- abstract class c#
- Category
- C#
- Title
- c# set textbox text
- Category
- C#
- Title
- how to run csharp in visual studio code
- Category
- C#
- Title
- unity persistent data
- Category
- C#
- Title
- jump script unity 2d
- Category
- C#
- Title
- bash if null or empty
- Category
- C#
- Title
- unity cancel invokerepeating
- Category
- C#
- Title
- C# datareadeer return null
- Category
- C#
- Title
- c sharp check if list contains
- Category
- C#
- Title
- add text to combobox c#
- Category
- C#
- Title
- how to get the last element in an array in c#
- Category
- C#
- Title
- fly cam extended script unity 3d
- Category
- C#
- Title
- MVC company assignments
- Category
- C#
- Title
- cc# sort list with list if ids
- Category
- C#
- Title
- what type of variable is true or false in c#
- Category
- C#
- Title
- c# random number between 0 and 1
- Category
- C#
- Title
- unity prevent system from creation
- Category
- C#
- Title
- how to get component in unity c#
- Category
- C#
- Title
- unity check if gameobject is active
- Category
- C#
- Title
- c# clear list items
- Category
- C#
- Title
- unity method on scene loaded
- Category
- C#
- Title
- c# merge two lists as queryable
- Category
- C#
- Title
- office open xml check if row is empty
- Category
- C#
- Title
- CS0103 C# The name 'Request.Url.Scheme' does not exist in the current context
- Category
- C#
- Title
- ping with c#
- Category
- C#
- Title
- list with two values c#
- Category
- C#