Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re^2: How can one create an array of the indices at which a given character appears in a string?

by tkguifan (Scribe)
on Jan 29, 2015 at 18:34 UTC ( [id://1114952]=note: print w/replies, xml ) Need Help??


in reply to Re: How can one create an array of the indices at which a given character appears in a string?
in thread How can one create an array of the indices at which a given character appears in a string?

I implemented this solution, so this code is already running in my program.
# collect coords where this piece is found on the board my @pos = grep substr( $self->{rep}, $_, 1 ) eq $piece, 0 .. length $s +elf->{rep};
  • Comment on Re^2: How can one create an array of the indices at which a given character appears in a string?
  • Download Code

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (5)
As of 2024-04-19 02:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found