split
Split a string into a list.
Syntax
tcl
split string ?splitChars?Parameters
- string: The string to split
- splitChars: Characters to split on (default: whitespace)
Description
Splits a string into a list of elements. Each character in splitChars is treated as a delimiter. If splitChars is an empty string, the string is split into individual characters.
Examples
Default split (whitespace)
Output
Split on specific character
Output
Split into characters
Output
Multiple delimiter characters
Output
Parsing CSV-like data
Output
