--- trunk/lib/Frey/Web.pm 2008/12/09 20:31:26 764 +++ trunk/lib/Frey/Web.pm 2008/12/09 20:31:42 781 @@ -679,4 +679,20 @@ qq||; } +=head2 strip + +Strip whitespace around content + + my $stripped = strip(' no more whitespace around this '); + +=cut + +sub strip { + my $t = shift; + $t =~ s{^\s+}{}gs; + $t =~ s{>\s+<}{><}gs; + $t =~ s{\s+$}{}gs; + return $t; +} + 1;