Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: index using a range

by trizen (Hermit)
on Jun 14, 2013 at 17:23 UTC ( #1039006=note: print w/replies, xml ) Need Help??


in reply to index using a range

Using index with tr/// :

    perl -E 'say index("000001000"=~tr/0/1/cr, "1")' # says "5"

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1039006]
help
Chatterbox?
[LanX]: https://en. oxforddictionaries .com/explore/words -with-silent-h
[LanX]: it's 'orrible zis langage...
[Your Mother]: Hon, hon, hon!

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (10)
As of 2017-03-27 17:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should Pluto Get Its Planethood Back?



    Results (321 votes). Check out past polls.