<se**********@yahoo.com> wrote:
Is there a way to search a string for a whole word w/o using a regular
expression?
i.e.
mystring.IndexOf(mypattern, *WholeWord);
Do you know what word separators will be involved? In other words, will
there always be spaces between words?
The reason i rather not use a regular expression is because sometimes i
want to search for whole words w/o the regular expression special
characters being interpreted.
You can use Regex.Escape to escape all the special characters, then use
the normal word boundary character classes etc. That sounds like the
best bet here, unless the word delimiter will always be the exact same
thing.
--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog:
http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too