1.6 KiB
1.6 KiB
title | description | menu | weight | ||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
strings.joinStr() function | `strings.joinStr()` concatenates elements of a string array into a single string using a specified separator. |
|
101 |
strings.joinStr()
concatenates elements of a string array into a single string using a specified separator.
Function type signature
(arr: [string], v: string) => string
{{% caption %}}For more information, see Function type signatures.{{% /caption %}}
Parameters
arr
({{< req >}}) Array of strings to concatenate.
v
({{< req >}}) Separator to use in the concatenated value.
Examples
Join a list of strings into a single string
import "strings"
strings.joinStr(arr: ["foo", "bar", "baz", "quz"], v: ", ")// Returns "foo, bar, baz, quz"