docs-v2/content/flux/v0.x/stdlib/strings/joinstr.md

1.0 KiB

title description aliases menu weight introduced
strings.joinStr() function The strings.joinStr() function concatenates the elements of a string array into a single string using a specified separator.
/influxdb/v2.0/reference/flux/functions/strings/joinstr/
/influxdb/v2.0/reference/flux/stdlib/strings/joinstr/
/influxdb/cloud/reference/flux/stdlib/strings/joinstr/
flux_0_x_ref
name parent
strings.joinStr strings
301 0.18.0

The strings.joinStr() function concatenates elements of a string array into a single string using a specified separator.

Output data type: String

import "strings"

strings.joinStr(arr: ["a", "b", "c"], v: ",")

// returns "a,b,c"

Parameters

arr

The array of strings to concatenate.

v

The separator to use in the concatenated value.

Examples

Join a list of strings into a single string
import "strings"

searchTags = ["tag1", "tag2", "tag3"]

strings.joinStr(arr: searchTags, v: ","))