Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

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

( #44560=categorized answer: print w/ replies, xml ) Need Help??

Q&A > strings > How can I find the first position of a substring case-insensitively? 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 the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (5)
As of 2014-12-25 13:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (160 votes), past polls