#assuming $n contains the number $string =~ s/^(.{$n})//; $first_n = $1;