text...ring(3tcl)
β¨ textutil::string β it's giving string manipulation, bestie β¨
okay so this is the page for textutil::string, from the tcllib collection of text and string utilities / macro processing tools, filed under section 3tcl of the manual. it's a whole lil package of string wrangling procs and honestly? obsessed. π
π NAME π
textutil::string β Procedures to manipulate texts and strings.
πΈ 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 literally just a lil grab-bag of miscellaneous string manipulation commands. that's the whole vibe. the entire set of procedures is described right below, no gatekeeping here π«Ά
::textutil::string::chop stringβ a convenience command, bestie. it takes the last character of string and yeets it into the void, handing back the shortened string. bye felicia π::textutil::string::tail stringβ also a convenience command. this one removes the first character of string and returns the shortened string. so like, the opposite end of the same energy π¦::textutil::string::cap stringβ capitalizes the first character of string and returns the modified string. glow-up for your first letter β¨::textutil::string::capEachWord stringβ capitalizes the first character of every word in the string and returns the modified string. iconic. but β and this is important β words quoted with either a backslash or a dollar-sign are left untouched. do not touch those, they're protected π::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. the anti-glow-up, if you will π::textutil::string::longestCommonPrefixList list::textutil::string::longestCommonPrefix ?string...?β these two compute the longest common prefix for either the strings handed directly to the command, or the strings specified in the single list, and return it as the result of the command.
and the edge cases, because we love a well-behaved proc:
- if no strings were specified, the result is the empty string.
- if only one string was specified, that string itself is returned β because it's its own longest common prefix, main character energy, no competition π
π BUGS, IDEAS, FEEDBACK π
ngl, this document and the package it describes will undoubtedly contain bugs and other problems. it's not a vibe, it's just reality. please report them in the category textutil of the Tcllib Trackers at:
http://core.tcl.tk/tcllib/reportlist
also please report any ideas for enhancements you have for either the package and/or the documentation, because we wanna hear it fr fr π«Ά
when you're proposing code changes, please provide unified diffs, i.e. the output of diff -u. no freestyle.
also note: attachments are strongly preferred over inlined patches. you can attach stuff by going to the Edit form of the ticket immediately after creating it, and then using the left-most button in the secondary navigation bar. iykyk π
π SEE ALSO π
regexp(3tcl), split(3tcl), string(3tcl)
π KEYWORDS π
capitalize, chop, common prefix, formatting, prefix, string, uncapitalize
π CATEGORY π
Text processing
tcllib, version 0.9, dated text...ring(3tcl) β that's the whole page, bestie. go forth and manipulate some strings, you've got this πβ¨π
π¦ where this page comes from
- debian trixie: tcllib 2.0+dfsg-4 Β· Tcl
- ubuntu questing: tcllib 2.0+dfsg-4
- ubuntu resolute: tcllib 2.0+dfsg-5 Β· Tcl
- ubuntu stonking: tcllib 2.0+dfsg-6 Β· Tcl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms