API Reference › Text › Text.split
method

Text.split

Text.split(s, sep) -> []string

Splits s at every occurrence of the non-empty separator sep and returns the pieces as a []string — the inverse of Text.join. Adjacent separators yield empty pieces, and a string with no separator returns a one-element list holding the whole string. Use it to parse CSV rows, command arguments, or delimited save data.

Example

program Demo {
  handler Step phase Update {
    let fields = Text.split(line, ",")
  }
}
← All symbols