У меня есть цикл foreach, и я хочу посмотреть, есть ли в цикле следующий элемент, поэтому я могу сравнить текущий элемент со следующим. Как я могу это сделать? Я читал о текущих и следующих функциях, но я не могу понять, как их использовать.
Заранее спасибо