Concat

Concat( value, [ separator ] )
Concat( value, [ separator ] )
Concat( value, [ separator ] )
Concat( value, [ separator ] )
concat( value, [ separator ] )
concat( value, [ separator ] )
Concat( value, [ separator ] )
Concat( value, [ separator ] )

Description

The Concat function returns a string which has joined a list of strings into a single string.

Parameters

Argument Type Definition and Requirements

value

Array of Strings

An array of strings to join.

separator

String

Optional - This value is placed between each joined string. Default is an empty string ("").

Returns

A string value.

Examples

The query below takes an array of Strings containing "Hen" and "Wen" as its first argument and a separator of a space (" ") as its second argument. The result of the Concat operation is "Hen Wen".

curl https://db.fauna.com/ \
    -u fnAChGwBcAACAO70ziE0cfROosNJHdgBmJU1PgpL: \
    -d '{ "concat": [ "Hen", "Wen" ], "separator": " " }'
client.Query(Concat(Arr("Hen", "Wen"), " "));
System.out.println(
     client.query(Concat(Arr(Value("Hen"), Value("Wen")), Value(" ")))
     .get());
result, _ := client.Query(f.Concat(f.Arr{"Hen", "Wen"}, f.Separator(" ")))

fmt.Println(result)
client.query(Concat(Arr("Hen", "Wen"), " "))
client.query(q.concat(["Hen", "Wen"], " "))
$client.query do
  concat ['Hen', 'Wen'], ' '
end
client.query(Concat("Hen", "Wen", separator: " "))
client.query(q.Concat(["Hen", "Wen"], " "))
  .then((ret) => console.log(ret))
HTTP/1.1 200 OK
{ "resource": "Hen Wen" }
"Hen Wen"
"Hen Wen"
Hen Wen
"Hen Wen"
"Hen Wen"
"Hen Wen"
"Hen Wen"
Hen Wen

Was this article helpful?

We're sorry to hear that.
Tell us how we can improve! documentation@fauna.com

Thank you for your feedback!