I want to replace string[,]
2D array
public static readonly string[,] first =
{
{"2", " ", " ", " ", "1"},
{"2", " ", "4", "3", " "},
{" ", "2", " ", "1", " "},
{" ", "1", " ", "3", " "},
{"1", " ", " ", " ", " "}
};
into int[,]
array
int X=-1;
public static readonly int[,] second =
{
{2, X, X, X, 1},
{2, X, 4, 3, X},
{X, 2, X, 1, X},
{X, 1, X, 3, X},
{1, X, X, X, X}
};
Is it possible to convert a string[,]
array to an int[,]
array? If yes, how can I convert the string[,]
into int[,]
? Thank you.