Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
String::Trim(3)	      User Contributed Perl Documentation      String::Trim(3)

NAME
       String::Trim - trim whitespace from your	strings

VERSION
       version 0.005

SYNOPSIS
	   use String::Trim;

	   print "Do it? ";
	   trim(my $response = <>);
	   print "'$response'\n";

DESCRIPTION
       "String::Trim" trims whitespace off your	strings. chomp trims only $/
       (typically, that's newline), but	"trim" will trim all leading and
       trailing	whitespace.

FUNCTIONS
   trim
       Returns the string with all leading and trailing	whitespace removed.
       Trimming	undef gives you	undef. Alternatively, you can trim in-place.

	   my $var     = ' my string  ';
	   my $trimmed = trim($var);
	   # OR
	   trim($var);

       "trim" also knows how to	trim an	array or arrayref:

	   my @to_trim = (' one	', ' two ', ' three ');
	   my @trimmed = trim(@to_trim);
	   # OR
	   trim(@to_trim);
	   # OR
	   my $trimmed = trim(\@to_trim);
	   # OR
	   trim(\@to_trim);

RATIONALE
       "trim" is often used by beginners, who may not understand how to	spin
       their own. While	String::Util does have a "trim"	function, it depends
       on Debug::ShowStuff, which depends on Taint, which fails	the test
       suite, and doesn't appear to be maintained.  This module	installs, is
       actively	maintained, and	has no non-core	dependencies.

       Other options include Text::Trim	and String::Strip (which is
       implemented in XS, and is therefore likely to be	very fast, but
       requires	a C compiler).

AVAILABILITY
       The latest version of this module is available from the Comprehensive
       Perl Archive Network (CPAN). Visit <http://www.perl.com/CPAN/> to find
       a CPAN site near	you, or	see
       <http://search.cpan.org/dist/String-Trim/>.

       The development version lives at
       <http://github.com/doherty/String-Trim> and may be cloned from
       <git://github.com/doherty/String-Trim.git>.  Instead of sending
       patches,	please fork this project using the standard git	and github
       infrastructure.

SOURCE
       The development version is on github at
       <http://github.com/doherty/String-Trim> and may be cloned from
       <git://github.com/doherty/String-Trim.git>

BUGS AND LIMITATIONS
       No bugs have been reported.

       Please report any bugs or feature requests through the web interface at
       <https://github.com/doherty/String-Trim/issues>.

CREDITS
       This module was inspired	by code	at
       <http://www.perlmonks.org/?node_id=36684> written by japhy (Jeff
       Pinyan),	dragonchild, and Aristotle. This Perl module was written by
       Mike Doherty.

AUTHORS
       o   Mike	Doherty	<doherty@cpan.org>

       o   Jeff	Pinyan <pinyan@cpan.org>

       o   Rob Kinyon <rkinyon@cpan.org>

       o   III^1III?III>>I.I I I+-I^3IoI+-I>>II<paragraph>I(R)I	(Aristotle
	   Pagaltzis) <aristotle@cpan.org>

COPYRIGHT AND LICENSE
       This software is	copyright (c) 2010 by Mike Doherty.

       This is free software; you can redistribute it and/or modify it under
       the same	terms as the Perl 5 programming	language system	itself.

perl v5.32.1			  2011-04-21		       String::Trim(3)

NAME | VERSION | SYNOPSIS | DESCRIPTION | FUNCTIONS | RATIONALE | AVAILABILITY | SOURCE | BUGS AND LIMITATIONS | CREDITS | AUTHORS | COPYRIGHT AND LICENSE

Want to link to this manual page? Use this URL:
<https://www.freebsd.org/cgi/man.cgi?query=String::Trim&sektion=3&manpath=FreeBSD+13.0-RELEASE+and+Ports>

home | help