Sudoku.Sudoku.FromString C# (CSharp) Method

FromString() static private method

static private FromString ( string data ) : ].int[
data string
return ].int[
        static int[,] FromString(string data)
        {
            var sudoku = new int[BOARD_SIZE, BOARD_SIZE];
            int i = 0, j = 0;
            foreach (char c in data)
            {
                if (Char.IsDigit(c))
                {
                    sudoku[i, j] = c - 48;
                    if (j == BOARD_SIZE - 1)
                    {
                        i += 1 % BOARD_SIZE;
                        j = 0;
                    }
                    else
                    {
                        j += 1 % BOARD_SIZE;
                    }
                }
            }
            return sudoku;
        }