indexof exactvalue match
<p>environment: microsoft visual studio 2008 c#</p>

<p>How do I get the index of a whole word found in a string</p>

<pre><code>string dateStringsToValidate = "birthdatecake||birthdate||other||strings";
string testValue = "birthdate";

var result = dateStringsToValidate.IndexOf(testValue);
</code></pre>

<p>It doesn't have to be the way i did it either, for example, would it be better to use regular expressions or other methods?</p>

<p><strong>Update:</strong>
The word is birthdate not birthdatecake. it doesn't have to retrieve the match but the index should find the right word. i don't think IndexOf is what i'm looking for then. Sorry for being unclear.</p>
