in reply to Problem in "index" function in recognizing repeating substrings
to give 0 and 2 or 0 and 6?my $str = "ATCGATCGAT"; my @substr = qw(ATCG CGAT);
If the latter, do
$id = -1; foreach (@substr) { my $id = index($str,$_,$id); print "$id\n"; $id += length($_); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Problem in "index" function in recognizing repeating substrings
by reasonablekeith (Deacon) on Sep 02, 2005 at 14:29 UTC | |
|
Re^2: Problem in "index" function in recognizing repeating substrings
by monkfan (Curate) on Sep 02, 2005 at 14:52 UTC | |
by saberworks (Curate) on Sep 02, 2005 at 16:05 UTC |