strings.splitAfterN() function

The strings.splitAfterN() function splits a string after a specified separator and returns an array of i substrings. Split substrings include the separator t.

Output data type: Array of strings

import "strings"

strings.splitAfterN(v: "a flux of foxes", t: " ", i: 3)

// returns ["a ", "flux ", "of foxes"]



The string value to split.

Data type: String


The string value that acts as the separator.

Data type: String


The maximum number of split substrings to return. -1 returns all matching substrings. The last substring is the unsplit remainder.

Data type: Integer


Split a string into an array of substrings
import "strings"

  |> map (fn:(r) => strings.splitAfterN(v: r.searchTags, t: ","))

New! Cloud or OSS?

InfluxDB OSS 2.0 now generally available!

InfluxDB OSS 2.0 is now generally available and ready for production use. See the InfluxDB OSS 2.0 release notes.

For information about upgrading to InfluxDB OSS 2.0, see: