in reply to How can I do this action WITHOUT split?
Hi,
in C this solution would also work and would be MUCH faster:
my $source_pos = 0; my $end_string = $str_with_dash; for (my $i = 0; $i < length $str_with_dash; $i++) { next if substr($str_with_dash, $i, 1) eq '-'; substr($end_string, $i, 1) = substr($str_no_dash, $source_pos, 1); $source_pos++; }
Best regards
McA
|
|---|