Hi! Take a look at my code, my problem is that commaLocation1 is taking the value "2" when is supossed to be "4". Please help me to find the bug. Thanks in advance.
namespace Lab8
{
class Program
{
static void Main(string[] args)
{
//Read user input
Console.Write("Type the values with the next format: <pyramid slot number>,<Block letter>,<Whether or not the block should be lit> ---> ");
string userInput = Console.ReadLine();
//Store pyramid slot number
int commaLocation0 = userInput.IndexOf(',');
int slotNumber = int.Parse(userInput.Substring(0, commaLocation0));
//Print slot number
Console.WriteLine("Pyramid slot number: " + slotNumber);
//Store block letter
int commaLocation1 = userInput.IndexOf(',', commaLocation0 + 1);
char blockLetter = char.Parse(userInput.Substring(commaLocation0 + 1, 1));
//Print block letter
Console.WriteLine("Block letter: " + blockLetter);
//Store whether or not the block should be lit
/*bool blockLit = bool.Parse(userInput.Substring(commaLocation1 + 1));
//Print block lit
Console.WriteLine("Should the block be lit?: " + blockLit);*/
Console.ReadKey();