Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
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 the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (1)
As of 2016-07-30 12:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What is your favorite alternate name for a (specific) keyboard key?


















    Results (265 votes). Check out past polls.