Split

str_split

Split a string on a delimiter and store the result in the STR_SPLIT array. Defaults to whitespace splitting when no delimiter is given. Uses portable read loop instead of readarray/mapfile.

Arguments

  • $1 (string): Optional: -d|--delimiter followed by delimiter character
  • ... (string): The string to split

Exit codes

  • 0: Always