Created
May 11, 2019 19:07
-
-
Save zfenj/30d6fe55de03823d87627fd23d8c60c4 to your computer and use it in GitHub Desktop.
ZSH string manipulation: split string
This file contains 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