s/\s(\s+)/" " . (" " x length ($1))/ge
use strict; use warnings; my $str = "Joe said hello"; print "\"$str\" --> \""; $str =~ s/\s(\s+)/" " . (" " x length ($1))/ge; print $str . "\"\n"; "Joe said hello" --> "Joe said hello"
In reply to Re: Converting multiple spaces to nbsp
by GrandFather
in thread Converting multiple spaces to nbsp
by eastcoastcoder
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |