[Gambas-user] Hi and case-insensitive text searches?

Benoit Minisini gambas at ...1...
Sun Jan 2 15:51:35 CET 2005


On Sunday 02 January 2005 12:34, Eckhart Wörner wrote:
> Hi,
>
> Am Sonntag, 2. Januar 2005 12:17 schrieb Paul Renhard:
> > Now, my first problem is that I'm doing a simple text search using
> > Instr(). This works fine but is case
> > sensitive, I would like to do a case-insensitve search! Is there an easy
> > way of doing this or am I going to have to code a little loop that takes
> > each character of the search string and converts its case for searching?
>
> the easiest way is to convert both strings to lower case and then compare
> them:
>
> PRINT Instr(Lower("This is the string you are searching in"),
> Lower("String")) ' Returns 13
>
> Eckhart

I just want to warn that these functions only works in ASCII. If you need 
international comparison, look at the String class.

Regards,

-- 
Benoit Minisini
mailto:gambas at ...1...




More information about the User mailing list