use warnings; use strict; my $str = 'ac-t-c-t-g'; my $s2; my $i = 0; for (split //, $str) { $s2 .= $_; $i++ if $_ ne '-'; last if $i == 4; } print "$s2\n";
In reply to Re: Perl match
by toolic
in thread Perl match
by nicholaspr
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |