string[,] Arr = new string[4, 5]{{"1A" , " 2A" , " 3A" , " 4A" , " 5A"},
{"1B" , " 2B" , " 3B" , " 4B" , " 5B"},
{"1C" , " 2C" , " 3C" , " 4C" , " 5C"},
{"1D" , " 2D" , " 3D" , " 4D" , " 5D"}};
Console.WriteLine("List of availabe seats.");
Console.WriteLine();
for (int s = 0; s < Arr.Length; s++)
{
for (int i = 0; i < Arr.GetLength(0); i++)
{
for (int k = 0; k < Arr.GetLength(1); k++)
{
Console.Write(Arr[i, k]);
}
Console.WriteLine();
}
Console.WriteLine("Enter your seat: ");
string textToReplace = Console.ReadLine() ;
for (int row = Arr.GetLowerBound(0); row <= Arr.GetUpperBound(0); ++row)
{
for (int column = Arr.GetLowerBound(1); column <= Arr.GetUpperBound(1); ++column)
if (Arr[row, column].Contains( textToReplace))
{
Arr[row, column] = " X ";
}
How to ignore cases and to output "Already Taken" and "Fully Booked" if the seat is taken or full? If I use StringComparison.CurrentCultureIgnoreCase its error because .Contains is only for int. Am I right? And I don't get the logic to output "Already Taken" and "Fully Booked" if the seat is taken or full.