So you are using 1 based numbering and you need to do the following:
use strict; use warnings; my $seq= 'ABCDEFGHIJKLM'; my $start=5; my $end=7; print substr $seq, $start - 1, ($end - $start) + 1;
Prints:
EFG
In reply to Re^2: get substring when you know START and END???
by GrandFather
in thread get substring when you know START and END???
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |