in reply to Best way to put : between fields in a string
Using $,
my $s = 'A3xyz45M98AB7Z9'; local $, = ":"; print split /(?<=\d)(?=\D)/, $s;
Using $"
my $s = 'A3xyz45M98AB7Z9'; local $" = ":"; print "@{[split /(?<=\d)(?=\D)/, $s]}";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Best way to put : between fields in a string
by cog (Parson) on Apr 21, 2005 at 12:02 UTC |