Last active
February 7, 2018 10:11
-
-
Save rebolek/da7f38e0e7a641000ad70a43660f2abc to your computer and use it in GitHub Desktop.
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
| Red[] | |
| join: func [ | |
| "Reduce values in a block and joins them into a string" | |
| block [block!] | |
| /with "Add delimiter between values" | |
| delimiter | |
| /trim "Remove NONE values" | |
| ] [ | |
| if empty? block [return ""] | |
| block: reduce block | |
| if trim [block: system/words/trim block] | |
| if with [ | |
| with: make block! 2 * length? block | |
| foreach value block [repend with [value delimiter]] | |
| block: head remove back tail with | |
| ] | |
| append copy "" block | |
| ] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment