X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2FRecord.pm;h=7ec8117523fa6bdfc8161dfaad9a54d77819adf7;hb=6262584c58bdc26ee7e7958e3a96483efe88500e;hp=7f76d99885e9ccfd962169ed79419d81ac23c5c1;hpb=a21d07037590cccd5ac5c572f5d28f062c622968;p=freeside.git diff --git a/FS/FS/Record.pm b/FS/FS/Record.pm index 7f76d9988..7ec811752 100644 --- a/FS/FS/Record.pm +++ b/FS/FS/Record.pm @@ -3220,6 +3220,22 @@ sub ut_agentnum_acl { } +=item trim_whitespace FIELD[, FIELD ... ] + +Strip leading and trailing spaces from the value in the named FIELD(s). + +=cut + +sub trim_whitespace { + my $self = shift; + foreach my $field (@_) { + my $value = $self->get($field); + $value =~ s/^\s+//; + $value =~ s/\s+$//; + $self->set($field, $value); + } +} + =item fields [ TABLE ] This is a wrapper for real_fields. Code that called