split chars
for strings
Split a string into a list of characters.
Signature
> split chars --grapheme-clusters --code-points
Parameters
--grapheme-clusters
(-g)
: split on grapheme clusters--code-points
(-c)
: split on code points (default; splits combined characters)
Examples
Split the string into a list of characters
> 'hello' | split chars
╭───┬───╮
│ 0 │ h │
│ 1 │ e │
│ 2 │ l │
│ 3 │ l │
│ 4 │ o │
╰───┴───╯
Split on grapheme clusters
> '🇯🇵ほげ' | split chars -g
╭───┬────╮
│ 0 │ 🇯🇵 │
│ 1 │ ほ │
│ 2 │ げ │
╰───┴────╯