Skip to content

Instantly share code, notes, and snippets.

View bambam2174's full-sized avatar
🌴
On vacation && just making myself learn and/or deepen new sklills & knowledge..!

Sedat Kilinc bambam2174

🌴
On vacation && just making myself learn and/or deepen new sklills & knowledge..!
View GitHub Profile
@mattmc3
mattmc3 / split.zsh.md
Last active October 15, 2025 19:50
ZSH - split string into array

There are a ton of different ways to split up a string in Zsh. This gist attempts to show them with examples to help you build your own. I write Zsh scripts all the time, and still reference back to this gist, so there you go.

From the Zsh docs on Parameter Expansion Flags (yeah - I know... how would anyone ever find that if they didn't know where to look!?)

j:string: Join the words of arrays together using string as a separator.
s:string: Force field splitting at the separator string.

You can also read more by running man zshexpn. (Again, I know, right!? How would anyone know to look there!?)