i need some help. I have to write a programm where you can do some calculation with matrices.
The User input should be for example: A=[1,2,3;4,5,6;7,8,9]
The user should be able to save up to 10 matrices. The user should be able to write operations like A+B or C*D
I want to check, if the first character of the users input is a letter, if not, i want to give an exception. Is there a method in c# where you can check if the first character is a letter. I want to save the letters into a string array so I can reference the name of the matrices to the int [,] which contains the matrices. Here is a snippet of my code:
int i = 0;
int[][,] ArrayContainer = new int[10][,];
int rowcount;
int columncount;
while (i < 10)
{
string input = Console.ReadLine();
string trimedinput;
if (input.Contains(" "))
{
trimedinput = input.Replace(" ", string.Empty);
}
else if (input == String.Empty)
{
break;
}
else if(!input.Contains("="))
{
Console.WriteLine("The definition of your matrix is not correct. Please type in 'help' if you need help.");
continue;
}
else
{
trimedinput = input;
}
}
Thank you for help!