Skip to main content
split(separator, str) divides str at every occurrence of separator and returns a list of the parts.

Signature

Example

Accept a comma-separated list of services as a variable and run a command for each one:
With the default value, computed.service_list becomes ["api", "worker", "scheduler"].

Notes

  • If separator does not appear in str, the result is a list with one element: the original string.
  • Consecutive separators produce empty strings in the result. Use compact to remove them.
  • To join a list back into a string, use join.