docs-v2/content/v2.0/reference/flux/stdlib/strings/splitafter.md

1.0 KiB

title description aliases menu weight related
strings.splitAfter() function The strings.splitAfter() function splits a string after a specified separator and returns an array of substrings.
/v2.0/reference/flux/functions/strings/splitafter/
v2_0_ref
name parent
strings.splitAfter Strings
301
/v2.0/reference/flux/stdlib/strings/split
/v2.0/reference/flux/stdlib/strings/splitaftern
/v2.0/reference/flux/stdlib/strings/splitn

The strings.splitAfter() function splits a string after a specified separator and returns an array of substrings.

Output data type: Array of strings

import "strings"

strings.splitAfter(v: "a flux of foxes", t: " ")

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

Parameters

v

The string value to split.

Data type: String

t

The string value that acts as the separator.

Data type: String

Examples

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

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