![]() |
![]()
| ![]() |
![]()
NAMEText::Truncate - Perl module with simple string truncating routine. SYNOPSISuse Text::Truncate; my $long_string = "This is a very long string"; # outputs "This is..." print truncstr( $long_string, 10); # outputs "This is a-" print truncstr( $long_string, 10, "-"); # outputs "This is a " print truncstr( $long_string, 10, ""); # outputs "This is---" $Text::Truncate::DEFAULT_MARKER = "---"; print truncstr( $long_string, 10); DESCRIPTIONThis is a simple, no-brainer subroutine to truncate a string and add an optional cutoff marker (defaults to ``...''). (Yes, this is a really brain-dead sort of thing to make a module out of, but then again, I use it so often that it might as well be in a module.) The synopsis gives examples of how to use it. EXPORTThe following functions are exported:
SEE ALSOL<String::Truncate>, L<Text::Elide> REPOSITORYhttps://github.com/ileiva/Text-Truncate AUTHORRobert Rothenberg <rrwo at cpan.org> This is now being mantained by Israel Leiva <ilv@cpan.org> LICENSEUnrestricted. This module is in the public domain. No copyright is claimed.
|