textu...tring(n)
β¨ NAME β¨
textutil::string β bestie, it's the procedures to manipulate texts and strings π (from the textu...tring(n) page, which lives in the "Text and string utilities, macro processing" corner of the manual world π)
πΈ SYNOPSIS πΈ
package require Tcl 8.5 9
package require textutil::string ?0.9?
::textutil::string::chop string
::textutil::string::tail string
::textutil::string::cap string
::textutil::string::capEachWord string
::textutil::string::uncap string
::textutil::string::longestCommonPrefixList list
::textutil::string::longestCommonPrefix ?string...?
π DESCRIPTION π
So the package textutil::string is giving "miscellaneous string manipulation commands" β¨ β like, a little grab-bag of string glow-ups, no cap. Here's the complete set of procedures, described one by one, because we do not skip π
::textutil::string::chop stringβ a convenience command, lowkey iconic. It removes the last character of string and hands you back the shortened string. Bye bye last letter π¦::textutil::string::tail stringβ another convenience command. This one removes the first character of string and returns the shortened string. Front character, you're out π::textutil::string::cap stringβ capitalizes the first character of string and returns the modified string. Main character energy for your first letter π::textutil::string::capEachWord stringβ capitalizes the first character of each word of the string and returns the modified string. But heads up bestie: words quoted with either a backslash or a dollar-sign are left untouched β they're protected, do not touch them π::textutil::string::uncap stringβ the complementary operation to::textutil::string::cap. It forces the first character of string to lower case and returns the modified string. Anti-capitalization, periodt π::textutil::string::longestCommonPrefixList list::textutil::string::longestCommonPrefix ?string...?β these two compute the longest common prefix for either the strings given to the command, or the strings specified in the single list, and return it as the result of the command. π«Ά
If no strings were specified, the result is the empty string. If only one string was specified, the string itself is returned, because it is its own longest common prefix β self-love, honestly π
π BUGS, IDEAS, FEEDBACK π
Not to be dramatic, but this document and the package it describes will undoubtedly contain bugs and other problems π Please report such in the category textutil of the Tcllib Trackers at http://core.tcl.tk/tcllib/reportlist. And please also report any ideas for enhancements you may have for either the package and/or the documentation β we want them, fr fr π₯Ί
When proposing code changes, please provide unified diffs, i.e. the output of diff -u. No vibes-based patches, bestie.
Also note further that attachments are strongly preferred over inlined patches. Attachments can be made by going to the Edit form of the ticket immediately after its creation, and then using the left-most button in the secondary navigation bar. Slay π
π¦ SEE ALSO π¦
regexp(n), split(n), string(n)
π KEYWORDS π
capitalize, chop, common prefix, formatting, prefix, string, uncapitalize
β CATEGORY β
Text processing
okay that's the whole page, you ate that π this one came from tcllib, version 0.9, page textu...tring(n) β go forth and capitalize things, iykyk πΈ
π¦ where this page comes from
- fedora 43: tcllib 2.0-3.fc43 Β· TCL
- fedora 44: tcllib 2.0-4.fc44 Β· TCL
- nixos 26.05: tcllib 2.0
- nixpkgs unstable: tcllib 2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms