Allow trim to return the trimmed whitespace if the caller wants them.

This commit is contained in:
acli 2004-02-17 07:26:29 +00:00
parent b318d2b8e3
commit a9edbfe34c

View file

@ -404,9 +404,8 @@ sub blank_p ($) {
sub trim ($) {
my($s) = @_;
$s =~ s/^(?:\s|\&nbsp$re_end_entity)+//os;
$s =~ s/(?:\s|\&nbsp$re_end_entity)+$//os;
return $s;
$s =~ /^(\s|\&nbsp$re_end_entity)*(.*)(\s|\&nbsp$re_end_entity)*$/os;
return wantarray? ($2, $1, $3): $2;
}
###############################################################################