in reply to removing 2 blanks from a string
This sounds like a job for split()!
$string = join(' ', split(/ +/,$string));
May work. Usually, I would split on white space, vs blanks, so I would usually do something like
$string = join(' ', split(/\s+/,$string));
If this is part of a more general text processing issue, I'd suggest taking a look at Text::Wrap or Text::Autoformat
emc
|
|---|