HTML::FormFu::Filter::TrimEdges - filter trimming whitespace


HTML-FormFu documentation Contained in the HTML-FormFu distribution.

Index


Code Index:

NAME

Top

HTML::FormFu::Filter::TrimEdges - filter trimming whitespace

DESCRIPTION

Top

Trim whitespaces from beginning and end of string.

AUTHOR

Top

Mario Minati, mario@minati.de

Based on the original source code of HTML::Widget::Filter::TrimEdges, by Sebastian Riedel, sri@oook.de

LICENSE

Top

This library is free software, you can redistribute it and/or modify it under the same terms as Perl itself.


HTML-FormFu documentation Contained in the HTML-FormFu distribution.

package HTML::FormFu::Filter::TrimEdges;

use Moose;
extends 'HTML::FormFu::Filter';

sub filter {
    my ( $self, $value ) = @_;

    return if !defined $value;

    $value =~ s/^\s+//;
    $value =~ s/\s+\z//;

    return $value;
}

__PACKAGE__->meta->make_immutable;

1;

__END__