I need help better understanding this piece of code from mosh’s solution on the string exercise, the first one where we were supposed to check if the numbers entered are consecutive.
for (i = 1; i < numbers.Count; i++)
{
if (number [i] != number[i-1] + 1) // This line, i know what it does but dont know how it works
{
is consecutive = false;
break;
}
}
Your help is greatly appreciated