X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2FRecord.pm;h=7e9a2e090963c8a1fa3c3c7ed952f7d0cf1585bf;hb=7334227ea36b450e71c028e7ba564f91e7d4d1de;hp=55cca08ca89dbe45f39f6f13fa263036e140c380;hpb=d75c483901028621700cad4c1b27e9ebc19d985d;p=freeside.git diff --git a/FS/FS/Record.pm b/FS/FS/Record.pm index 55cca08ca..7e9a2e090 100644 --- a/FS/FS/Record.pm +++ b/FS/FS/Record.pm @@ -3034,6 +3034,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