5. String Manipulation
This chapter describes Tcl’s facilities for manipulating strings. Internally, Tcl stores strings as Unicode characters, but Tcl supports a variety of other character sets and can translate between character sets automatically and on demand. Tcl also supports handling binary strings. Tcl’s string manipulation commands include pattern matching in two different forms: one that mimics the rules used by shells for file name expansion and another that uses regular expressions as patterns. Tcl also has commands for formatted input and output in a style similar to the C procedures scanf and printf. Finally, there are several utility commands for computing the length of a string, extracting characters from a string, case conversion, ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access