Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Case-insensitive string match 1

Status
Not open for further replies.

lorenzodv

Programmer
Feb 16, 2001
95
IT
Hi.

How do I compare two strings in text mode (case-insensitively)?

For example:
('word' eq 'WorD')
is false, how can I make it return "true"

Thanks.

--
Lorenzo
 
$word = "WorD";

$word =~ /^word$/i;


the i modifier makes it case insensitive. adam@aauser.com
 
Thanks!
I had already tried with regular expressions, but I did not put the ^ and $ characters, so it was matching even when $word just contained the pattern.
Now it works great.

--
Lorenzo
 
you could also say:
Code:
"word" eq lc("WoRd");
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top