title: Search from a list of string() in VB.NET
body: <p>I am trying to find if mylines() contains a value or not. I can get the value by mylines.Contains method:</p>
  
  <pre><code>Dim mylines() As String = IO.File.ReadAllLines(mypath)
  If mylines.Contains("food") Then
      MsgBox("Value Exist")
  End If
  </code></pre>
  
  <p>But the problem is that I want to check if mylines() contains a line which starts with my value. I can get this value from a single line by mylines(0).StartsWith method. But how do I find a string from all the lines which is starting from some value, e.g. "mysearch" and then get that line number?</p>
  
  <p>I am using a <code>for</code> loop to do so, but it is slow.</p>
  
  <pre><code>For Each line In mylines
      If line.StartsWith("food") Then MsgBox(line)
  Next
  </code></pre>
  
  <p>Constrained to code for .NET 2.0, please.</p>