NAME
YVDHOVE::String - Perl module that provides String functions used by the YVDHOVE framework
SYNOPSIS
use YVDHOVE::String qw(:all);
my $string = " \t Hello world! ";
print trim($string) ."\n";
print ltrim($string)."\n";
print rtrim($string)."\n";
DESCRIPTION
Perl doesn't have a built-in trim function. Use the subroutines below to trim whitespace (spaces and tabs) from the beginning and end of a string in Perl. These functions are directly based on the Perl FAQ entry "How do I strip blank spaces from the beginning/end of a string?" The ltrim and rtrim functions can trim leading or trailing whitespace.
EXPORT
None by default.
METHODS
- trim(STRING);
-
trim function to remove whitespace from the start and end of the string
- ltrim(STRING);
-
trim function to remove leading whitespace
- rtrim(STRING);
-
trim function to remove trailing whitespace
SEE ALSO
YVDHOVE::List YVDHOVE::String
AUTHORS
Yves Van den Hove, <yvdhove@users.sourceforge.net>
BUGS
See http://rt.cpan.org to report and view bugs.
COPYRIGHT AND LICENSE
Copyright (C) 2007 by Yves Van den Hove, <yvdhove@users.sourceforge.net>
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.x or, at your option, any later version of Perl 5 you may have available.