title: VB.NET Combination of For Each..Next and Do..While
body: <p>I have an array like so:</p>
  
  <pre><code>Dim classes() as String = {"FR%", "SO", "JR", "SR", "SR5"}
  </code></pre>
  
  <p>I need to loop through these values like so:</p>
  
  <pre><code>For Each value as String in classes
  
  Next
  </code></pre>
  
  <p>Problem is, I have a If..Then..Else clause inside of this For Each..Next which says something to the effect of:</p>
  
  <pre><code>If actual_class = value Then
    txt.Text = "Welcome"
  Else
    txt.Text = "Goodbye"
  </code></pre>
  
  <p>When I run this, unless the individual is the last value in the string array ("SR5") they are going to get the message "Goodbye"...so, I need somehow to both iterate through each value like is done with a For Each..Next loop but also break out of the loop once it hits the student's class, like a Do..While loop - so that their value doesn't get overrun by the Else clause.</p>