String...::More(3pm)
π String...::More(3pm) β aka String::Trim::More π
okay bestie, gather round, because this is the String...::More(3pm) manual page and it's genuinely so useful it's giving main character energy. It's the user-contributed Perl documentation for a lil module called String::Trim::More, and it's about to make your whitespace problems β¨disappearβ¨.
πΈ VERSION πΈ
This doc describes version 0.03 of String::Trim::More (from the Perl distribution String-Trim-More), released on 2017-01-27. Yes she's an elder but she still slays π
π¦ DESCRIPTION π¦
So here's the vibe: this module is an alternative to String::Trim (and friends β peep the SEE ALSO section, iykyk). The difference? Instead of one single trim function doing mystery-meat trimming, this module hands you several functions and lets you pick whichever one actually fits what you need. Choose your own adventure, bestie π
π FUNCTIONS π
π ltrim($str) => STR
Trims whitespaces (including newlines) from the beginning of the string. It's literally equivalent to:
$str =~ s/\A\s+//s;
π ltrim_lines($str) => STR
Trims whitespaces (not including newlines) at the beginning of each line of the string. Equivalent to:
$str =~ s/^\s+//mg;
π rtrim($str) => STR
Trims whitespaces (including newlines) at the end of the string. Equivalent to:
$str =~ s/[ \t]+\z//s;
π rtrim_lines($str) => STR
Trims whitespaces (not including newlines) at the end of each line of the string. Equivalent to:
$str =~ s/[ \t]+$//mg;
π trim($str) => STR
It's ltrim + rtrim. Both ends, one glow-up. π
π trim_lines($str) => STR
It's ltrim_lines + rtrim_lines. Every line gets the treatment. Periodt.
π trim_blank_lines($str) => STR
Trims blank lines at the beginning and the end. She will not touch blank lines in the middle β those stay, no cap. And heads up: "blank lines" here includes lines that have only whitespaces in them. Empty-looking but not actually empty, sneaky little things π
π ellipsis($str[, $maxlen, $ellipsis]) => STR
Returns $str totally unmodified if $str's length is less than $maxlen (default 80). Otherwise it cuts $str down to ($maxlen - length($ellipsis)) and tacks $ellipsis (default '...') onto the end. So dramatic. So concise. π₯
π«Ά HOMEPAGE π«Ά
Pls visit the project's homepage at <https://metacpan.org/release/String-Trim-More>. Go give it a lil look, it's iconic.
π§ SOURCE π§
The source repository lives at <https://github.com/perlancar/perl-String-Trim-More>. Fork it, star it, treat it right β
π BUGS π
Found a bug? Got a feature request? Report it on the bugtracker website: <https://rt.cpan.org/Public/Dist/Display.html?Name=String-Trim-More>
And when you submit a bug or a request, please include a test-file β or a patch to an existing test-file β that actually illustrates the bug or the feature you want. No vague vibes, bestie, we need receipts π
π SEE ALSO π
- For trim functions:
String::Trim,Text::Trim,String::Strip,String::Util. - For ellipsis/eliding:
Text::Elide(elide at word boundaries),String::Elide::Parts(elide with more options).
π AUTHOR π
perlancar <perlancar@cpan.org> β the legend themself π
π COPYRIGHT AND LICENSE π
This software is copyright (c) 2017 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. Free as in go off, fr fr.
and that's the whole page, bestie!! π This was String...::More(3pm) as documented for perl v5.34.0, dated 2022-06-17. Stay trimmed, stay slaying, and go touch some whitespace πΈβ¨π¦
π¦ where this page comes from
- debian bookworm: libstring-trim-more-perl 0.03-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libstring-trim-more-perl 0.03-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libstring-trim-more-perl 0.03-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libstring-trim-more-perl 0.03-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libstring-trim-more-perl 0.03-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms