GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  TEXT::TRUNCATE (3)

.ds Aq ’

NAME

Text::Truncate - Perl module with simple string truncating routine.

CONTENTS

SYNOPSIS



  use 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);



DESCRIPTION

This 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.

    EXPORT

The following functions are exported:
truncstr


  $rstring = truncstr( $istring, $cutoff_length );

  $rstring = truncstr( $istring, $cutoff_length, $continued_symbol );



If the $istring is longer than the $cutoff_length, then the string will be truncated to $cutoff_length characters, including the $continued_symbol (which defaults to ‘‘...’’ if none is specified).

The default $continued_symbol can be changed in $Text::Truncate::DEFAULT_MARKER.

SEE ALSO



 L<String::Truncate>, L<Text::Elide>



REPOSITORY



 https://github.com/ileiva/Text-Truncate



AUTHOR

Robert Rothenberg <rrwo at cpan.org> This is now being mantained by Israel Leiva <ilv@cpan.org>

LICENSE

Unrestricted. This module is in the public domain. No copyright is claimed.
Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 TEXT::TRUNCATE (3) 2014-02-25

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.