Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: How can I find the first position of a string within a string

by zejames (Hermit)
on Dec 01, 2000 at 18:25 UTC ( [id://44353]=note: print w/replies, xml ) Need Help??


in reply to How can I find the first position of a substring case-insensitively?

I think you could simply do this :

my $position = index(lc($mystr),"a");

You first "lowercase" the string, and then look for your substring into it.

HTH
James

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://44353]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (1)
As of 2024-04-24 13:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found