Check next string in the list
<p>Trying to figure out how to check the next string vs. the current string in a loop (pseudo code):</p>

<pre><code>string currentName = string.Empty;

for(int i=0; i &lt; SomeList.Count; i++)
{
    currentName = SomeList[i].Name;

    //do some other logic here

    if(string.Compare(SomeList[i].Name, SomeList[i+1].Name) == 0)
         // do something
}
</code></pre>

<p>this does not seem to work:</p>

<pre><code>if(string.Compare(SomeList[i].Name, SomeList[i+1].Name)
</code></pre>

<p>I want to see if the current string is the same as what the next string in the loop before it gets to the next iteration in the loop.</p>
