logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

textutil::string - Procedures to manipulate texts and strings.

Bugs, Ideas, Feedback

       This  document,  and  the package it describes, will undoubtedly contain bugs and other problems.  Please
       report such in the category  textutil  of  the  TcllibTrackers  [http://core.tcl.tk/tcllib/reportlist].
       Please also report any ideas for enhancements you may have for either package and/or documentation.

       When proposing code changes, please provide unifieddiffs, i.e the output of diff-u.

       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.

Category

       Text processing

tcllib                                                 0.9                                textutil::string(3tcl)

Description

       The package textutil::string provides miscellaneous string manipulation commands.

       The complete set of procedures is described below.

       ::textutil::string::chopstring
              A convenience command. Removes the last character of string and returns the shortened string.

       ::textutil::string::tailstring
              A convenience command. Removes the first character of string and returns the shortened string.

       ::textutil::string::capstring
              Capitalizes the first character of string and returns the modified string.

       ::textutil::string::capEachWordstring
              Capitalizes  the  first  character  of  word  of the string and returns the modified string. Words
              quoted with either backslash or dollar-sign are left untouched.

       ::textutil::string::uncapstring
              The complementary operation to ::textutil::string::cap. Forces the first character  of  string  to
              lower case and returns the modified string.

       ::textutil::string::longestCommonPrefixListlist::textutil::string::longestCommonPrefix ?string...?
              Computes  the  longest  common  prefix for either the strings given to the command, or the strings
              specified in the single list, and returns 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, as it is its own longest common prefix.

Keywords

       capitalize, chop, common prefix, formatting, prefix, string, uncapitalize

Name

       textutil::string - Procedures to manipulate texts and strings.

See Also

regexp(3tcl), split(3tcl), string(3tcl)

Synopsis

       package require Tcl8.59

       package require textutil::string?0.9?::textutil::string::chopstring::textutil::string::tailstring::textutil::string::capstring::textutil::string::capEachWordstring::textutil::string::uncapstring::textutil::string::longestCommonPrefixListlist::textutil::string::longestCommonPrefix ?string...?

________________________________________________________________________________________________________________

See Also