Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: finding the position of a particular character in a string

by NetWallah (Abbot)
on Oct 06, 2011 at 04:59 UTC ( #929933=note: print w/replies, xml ) Need Help??


in reply to finding the position of a particular character in a string

>perl -e "my $a=q|THE FOOD IS DELICIOUS|;for(my $x=-1;($x=index($a,qq| +O|,$x+1))>=0;){print qq|$x\n|}" 5 6 18

            "XML is like violence: if it doesn't solve your problem, use more."

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://929933]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (8)
As of 2017-02-22 11:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Before electricity was invented, what was the Electric Eel called?






    Results (327 votes). Check out past polls.