Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Answer: How can I find the first position of a substring case-insensitively?

by eg (Friar)
on Dec 02, 2000 at 11:55 UTC ( #44560=categorized answer: print w/replies, xml ) Need Help??

Q&A > strings > How can I find the first position of a substring case-insensitively? - Answer contributed by eg

The easiest thing to do would be to use lc on $mystr like so:

  my $index = index( lc( $mystr ), "a" );
Edited by Russ: Combined posts by ambiguous, tektsu, kilinrax, ariels, and tenatious into one

  • Comment on Answer: How can I find the first position of a substring case-insensitively?
Log In?
Username:
Password:

What's my password?
Create A New User
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (6)
As of 2017-04-29 06:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I'm a fool:











    Results (531 votes). Check out past polls.