Michael C <mi******@nospam.org> wrote:
string s = "aBcDXyZeFgHi";
Console.WriteLine (s.IndexOf("xYz", CompareOptions.IgnoreCase);
While using CompareOptions.IgnoreCase is indeed a great way to go (it
saves you having to create two new strings) the above doesn't quite
work. Instead, you need to use something like:
CompareInfo ci = CultureInfo.CurrentCulture.CompareInfo;
Console.WriteLine (ci.IndexOf(s, "xYz", CompareOptions.IgnoreCase));
--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too