Wednesday 23 April 2014

String Array 2D

String Array 2D
string[,] table = {
{"red", "blue", "green"},
{"Monday", "Wednesday", "Friday"}};
{
foreach (string str in table)
{
int row, colm;
for (row = 0; row <= 1; ++row)
{
for (colm = 0; colm <= 2; ++colm)
{
if (str == table[row, colm])
{
goto done;
}
}
}
Response.Write("{" + str + "} not found");
Response.Write("
");
continue;
done:
Response.Write("Found {" + str + "} at [{" + row + "}][{" + colm + "}]");
Response.Write("
");
}
}