title: VB InStr Equivalent in c#
body: <p>I am not sure why I get the result of <code>0</code>, which is the correct value of <code>a</code></p>
  
  <p>I have in VB</p>
  
  <pre><code>Dim searched As String = "&lt;results&gt;" &amp; vbCrLf &amp; "&lt;field name=\""FID\""/&gt;" &amp; vbCrLf &amp; "&lt;field name=\""StartFID\""/&gt;" &amp; vbCrLf &amp; "&lt;field name=\""Vertex1\""/&gt;" &amp; vbCrLf &amp; "&lt;field name=\""Vertex2\""/&gt;" &amp; vbCrLf &amp; "&lt;field name=\""Slope\""/&gt;" &amp; vbCrLf &amp; ""
  
  Dim sought As String = "&lt;rs FID=\""87\"" StartFID=\""87\"" Vertex1=\""29\"" Vertex2=\""30\"" Slope=\""-1\""/&gt;"
  
  Dim a As Integer = InStr(searched, sought)
  </code></pre>
  
  <p>What I would like to do, is get the same result of <code>a == 0</code> when converted to c#. </p>
  
  <p>I have tried</p>
  
  <pre><code>int a = String.Compare(searched, sought);
  int a = String.IndexOf(searched, sought);
  int a = String.Equals(searched, sought);
  </code></pre>