title: Find Array index that contains string
body: <p>I have file with tags and targets, this is example:</p>
  
  <pre><code>TAG1|TARGET1,TARGET2
  TAG2|TARGET3,TARGET4
  </code></pre>
  
  <p>I start by creating String Array using File.ReadAllLines</p>
  
  <pre><code>Dim MAIN As String() = File.ReadAllLines("")
  </code></pre>
  
  <p>At some point I have one of targets and I need to know what was the tag index (which array line is it), so for example if I have TARGET3 I want to know it's in second line so it's in MAIN(1) and then I can grab TAG = TAG2.</p>
  
  <p>I can't get it working, I tried few methods:</p>
  
  <pre><code>Array.IndexOf(MAIN,"TARGET3")
  </code></pre>
  
  <p>always returned -1, it worked with full string tho,</p>
  
  <pre><code>Array.IndexOf(MAIN,"TAG2|TARGET3,TARGET4")
  </code></pre>
  
  <p>returned 1. I tried with Array.FindIndex, was the same.</p>
  
  <p>So my question is: how to get index of partial array item. Thank you for any help.</p>