in reply to How can one create an array of the indices at which a given character appears in a string?
my $input = 'rnbqkbnr'; my $search = 'n'; my @results = grep substr( $input, $_, 1 ) eq $search, 0 .. length $in +put; print @results; 1 6
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
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 | |
|
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 14:09 UTC |