in reply to Adding formatting to a string
How about this?
Awkward, maybe, but I have tried it and it works.my $string = "ABCDEFGH"; $string = sprintf("%.4s-%s", $string,substr($string,4,4));
|
---|
In Section
Seekers of Perl Wisdom