I'm trying to replace a string value in a 2d array and tried this codes below but nothing is happening
foreach (string item in Arr)
{
if (UserInput.Equals(item))
{
item.Replace(UserInput, "X ");
}
}
and the same goes for this codes nothing is happening...
Console.WriteLine("Select a seat that you want to ocupy");
string ln = Console.ReadLine();
if (ln.Equals(Arr))
{
ln = ln.Replace(ln, "X ");
}
Arr. Is it astring[][]or astring[,]?string[,] Arr = new string[4,5]{ {"A1" , " A2" , " A3" , " A4" , " A5"}, {"B1" , " B2" , " B3" , " B4" , " B5"}, {"C1" , " C2" , " C3" , " C4" , " C5"}, {"D1" , " D2" , " D3" , " D4" , " D5"}, };`