Forked from zfenj/gist:30d6fe55de03823d87627fd23d8c60c4
Created
April 20, 2020 12:22
-
-
Save denise-amiga/ff5379829f29357a259dcf51c25ed901 to your computer and use it in GitHub Desktop.
ZSH string manipulation: split string
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://bougui505.github.io/2016/02/29/zsh_string_manipulation-_split_string.html | |
Split string in a given word separator (ws) | |
For example _: | |
# x="foo_1" | |
# echo $x[(ws:_:)1] | |
foo | |
# echo $x[(ws:_:)2] | |
1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment