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?
# collect coords where this piece is found on the board my @pos = grep substr( $self->{rep}, $_, 1 ) eq $piece, 0 .. length $s +elf->{rep};
|
|---|