@@ -7,6 +7,7 @@ \section{Standard Module \sectcode{regsub}}
77Warning: these functions are not thread-safe.
88
99\renewcommand {\indexsubitem }{(in module regsub)}
10+
1011\begin {funcdesc }{sub}{pat\, repl\, str}
1112Replace the first occurrence of pattern \var {pat} in string
1213\var {str} by replacement \var {repl}. If the pattern isn't found,
@@ -23,13 +24,28 @@ \section{Standard Module \sectcode{regsub}}
2324\code {gsub('', '-' , 'abc' )} returns \code {'-a-b-c-'}.
2425\end {funcdesc }
2526
26- \begin {funcdesc }{split}{str\, pat\optional {\, retain }}
27+ \begin {funcdesc }{split}{str\, pat\optional {\, maxsplit }}
2728Split the string \var {str} in fields separated by delimiters matching
2829the pattern \var {pat}, and return a list containing the fields. Only
2930non-empty matches for the pattern are considered, so e.g.
3031\code {split('a:b', ':*' )} returns \code {['a', 'b' ]} and
31- \code {split('abc', '' )} returns \code {['abc']}.
32- If the optional \var {retain} argument is true, the separators are also
33- inserted in the list, so e.g. \code {split('a:::b', ':*' , 1)} returns
34- \code {['a', ':::' , 'b' ]}.
32+ \code {split('abc', '' )} returns \code {['abc']}. The \var {maxsplit}
33+ defaults to 0. If it is nonzero, only \var {maxsplit} number of splits
34+ occur, and the remainder of the string is returned as the final
35+ element of the list.
36+ \end {funcdesc }
37+
38+ \begin {funcdesc }{splitx}{str\, pat\optional {\, maxsplit}}
39+ Split the string \var {str} in fields separated by delimiters matching
40+ the pattern \var {pat}, and return a list containing the fields as well
41+ as the separators. For example, \code {splitx('a:::b', ':*' )} returns
42+ \code {['a', ':::' , 'b' ]}. Otherwise, this function behaves the same
43+ as \code {split}.
44+ \end {funcdesc }
45+
46+ \begin {funcdesc }{capwords}{s\optional {\, pat}}
47+ Capitalize words separated by optional pattern \var {pat}. The default
48+ pattern uses any characters except letters, digits and underscores as
49+ word delimiters. Capitalization is done by changing the first
50+ character of each word to upper case.
3551\end {funcdesc }
0 commit comments