String::Elide::Tiny - A very simple text truncating function, elide()
This document describes version 0.001 of String::Elide::Tiny (from Perl distribution String-Elide-Tiny), released on 2019-09-11.
use String::Elide::Tiny qw(elide); # 0----5---10---15---20 my $text = "this is your brain"; elide($text, 16); # -> "this is your ..." elide($text, 14); # -> "this is yo ..."
This module offers "elide"() function that is very simple; it's not word-aware.
Usage:
my $truncated = elide($str, $max_len)
Elide a string with " ..." if length exceeds $max_len.
$max_len
Please visit the project's homepage at https://metacpan.org/release/String-Elide-Tiny.
Source repository is at https://github.com/perlancar/perl-String-Elide-Tiny.
Please report any bugs or feature requests on the bugtracker website https://rt.cpan.org/Public/Dist/Display.html?Name=String-Elide-Tiny
When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature.
Text::Elide is also quite simple and elides at word boundaries, but it's not tiny enough.
String::Elide::Parts can elide at different points of the string.
String::Truncate has similar interface like String::Elide::Parts and has some options.
String::Elide::Lines is based on this module but works on a line-basis.
perlancar <perlancar@cpan.org>
This software is copyright (c) 2019 by perlancar@cpan.org.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install String::Elide::Tiny, copy and paste the appropriate command in to your terminal.
cpanm
cpanm String::Elide::Tiny
CPAN shell
perl -MCPAN -e shell install String::Elide::Tiny
For more information on module installation, please visit the detailed CPAN module installation guide.