my $input = 'rnbqkbnr'; my $search = 'n'; my @results = grep substr( $input, $_, 1 ) eq $search, 0 .. length $in +put; print @results; 1 6
In reply to Re: How can one create an array of the indices at which a given character appears in a string?
by BrowserUk
in thread How can one create an array of the indices at which a given character appears in a string?
by tkguifan
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |