Allow trim to return the trimmed whitespace if the caller wants them.
This commit is contained in:
parent
b318d2b8e3
commit
a9edbfe34c
1 changed files with 2 additions and 3 deletions
|
@ -404,9 +404,8 @@ sub blank_p ($) {
|
|||
|
||||
sub trim ($) {
|
||||
my($s) = @_;
|
||||
$s =~ s/^(?:\s|\ $re_end_entity)+//os;
|
||||
$s =~ s/(?:\s|\ $re_end_entity)+$//os;
|
||||
return $s;
|
||||
$s =~ /^(\s|\ $re_end_entity)*(.*)(\s|\ $re_end_entity)*$/os;
|
||||
return wantarray? ($2, $1, $3): $2;
|
||||
}
|
||||
|
||||
###############################################################################
|
||||
|
|
Loading…
Reference in a new issue