title: How could I find the string position (index) from an XPath statement?
body: <p><a href="https://stackoverflow.com/questions/226405/find-position-of-a-node-using-xpath">This question</a> is close, but it's looking for the ordinal position. I'm looking for the actual index position in a given source string.</p>
  
  <p>Better Explanation:</p>
  
  <p>I have the following string</p>
  
  <pre><code>"&lt;a&gt;
      &lt;b&gt;zyx&lt;/b&gt;
      &lt;b&gt;wvu&lt;/b&gt;
      &lt;b&gt;tsr&lt;/b&gt;
      &lt;b&gt;qpo&lt;/b&gt;
  &lt;/a&gt;"
  </code></pre>
  
  <p>I'm loading that <strong>string</strong> into a .NET XmlDocument object. Carriage Returns and Line Fees may be a factor here.</p>
  
  <pre><code>Dim xmlSearchText As New XmlDocument()
  xmlSearchText.LoadXml(SearchTextBox.Text)
  
  Dim selectedNode As XmlNode = xmlSearchText.SelectSingleNode(txtSearch.Text)
  </code></pre>
  
  <p>The following XPath Statement could be used to find the 3rd node:</p>
  
  <pre><code>a/b[.='tsr']
  </code></pre>
  
  <p>However, I need it to return a string index of 23 rather than the ordinal position of 3.</p>
  
  <p>Possible? Not Possible?</p>