(-) Symbol Used in Convert Method
c#
Solution
The `-` (minus) does exactly what it always does - subtracting. What happens here is subtracting the character code of zero `'0'` from the character at `[i,j]`. This converts a digit character to an integer value of the corresponding digit. For example, if you calculate
char digitChar = '7';
int digitVal = digitChar - '0';
the value of `digitVal` is seven.
Problem
I was going through some C# code and came upon this line: ``` Matrix[i, j] = Convert.ToInt32(grab[i, j] - '0'); ``` What exactly does the ( - ) do?? What would be another way to write this if there is one?