1textutil::string(n)Text and string utilities, macro processintgextutil::string(n)
2
3
4
5______________________________________________________________________________
6

NAME

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

SYNOPSIS

11       package require Tcl  8.2
12
13       package require textutil::string  ?0.8?
14
15       ::textutil::string::chop string
16
17       ::textutil::string::tail string
18
19       ::textutil::string::cap string
20
21       ::textutil::string::capEachWord string
22
23       ::textutil::string::uncap string
24
25       ::textutil::string::longestCommonPrefixList list
26
27       ::textutil::string::longestCommonPrefix ?string...?
28
29______________________________________________________________________________
30

DESCRIPTION

32       The package textutil::string provides miscellaneous string manipulation
33       commands.
34
35       The complete set of procedures is described below.
36
37       ::textutil::string::chop string
38              A convenience command. Removes the last character of string  and
39              returns the shortened string.
40
41       ::textutil::string::tail string
42              A convenience command. Removes the first character of string and
43              returns the shortened string.
44
45       ::textutil::string::cap string
46              Capitalizes the first character of string and returns the  modi‐
47              fied string.
48
49       ::textutil::string::capEachWord string
50              Capitalizes  the  first  character  of  word  of  the string and
51              returns the modified string. Words quoted with either  backslash
52              or dollar-sign are left untouched.
53
54       ::textutil::string::uncap string
55              The  complementary  operation to ::textutil::string::cap. Forces
56              the first character of string to lower case and returns the mod‐
57              ified string.
58
59       ::textutil::string::longestCommonPrefixList list
60
61       ::textutil::string::longestCommonPrefix ?string...?
62              Computes  the longest common prefix for either the strings given
63              to the command, or the strings specified in the single list, and
64              returns it as the result of the command.
65
66              If no strings were specified the result is the empty string.  If
67              only one string was specified, the string itself is returned, as
68              it is its own longest common prefix.
69

BUGS, IDEAS, FEEDBACK

71       This  document,  and the package it describes, will undoubtedly contain
72       bugs and other problems.  Please report such in the  category  textutil
73       of  the Tcllib Trackers [http://core.tcl.tk/tcllib/reportlist].  Please
74       also report any ideas for enhancements you may have for either  package
75       and/or documentation.
76
77       When proposing code changes, please provide unified diffs, i.e the out‐
78       put of diff -u.
79
80       Note further that  attachments  are  strongly  preferred  over  inlined
81       patches.  Attachments  can  be  made  by  going to the Edit form of the
82       ticket immediately after its creation, and  then  using  the  left-most
83       button in the secondary navigation bar.
84

SEE ALSO

86       regexp(n), split(n), string(n)
87

KEYWORDS

89       capitalize, chop, common prefix, formatting, prefix, string, uncapital‐
90       ize
91

CATEGORY

93       Text processing
94
95
96
97tcllib                                0.8                  textutil::string(n)
Impressum