in reply to Remove whitespace in string and maintain overall length
use warnings; use strict; my $len = 30; my $address = '123 Main St NE'; $address =~ s/ +/ /g; $address = sprintf "%-${len}s", $address; print ">>>$address<<<\n"; __END__ >>>123 Main St NE <<<
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Remove whitespace in string and maintain overall length
by silentbob343 (Initiate) on Nov 19, 2015 at 19:16 UTC |