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

Eckhart Wörner ew at ...753...
Sun Jan 2 12:34:39 CET 2005


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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20050102/201d1bc9/attachment.sig>


More information about the User mailing list