Monday, July 03, 2006

Doing Case insensitive search through IndexOf

I just wanted to do a simple case insensitive search in VB.NET 2003. But the MS doesnt allow that with the string object itself. So how you do it

dim i as integer = System.Globalization.CultureInfo.CurrentCulture.CompareInfo.IndexOf(stringtosearch, searchstring,System.Globalization.CompareOptions.IgnoreCase)

I dont know why MS hid this method so faaaaaaaaaaaaaaaaaar.

Enjoy IT

Doing Case insensitive search through IndexOf

I just wanted to do a simple case insensitive search in VB.NET 2003. But the MS doesnt allow that with the string object itself. So you do it

dim i as integer = System.Globalization.CultureInfo.CurrentCulture.CompareInfo.IndexOf(stringtosearch, searchstring,System.Globalization.CompareOptions.IgnoreCase)

Enjoy IT