Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
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."


Comment on Re: finding the position of a particular character in a string
Download Code

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 chanting in the Monastery: (2)
As of 2014-07-31 00:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (242 votes), past polls