How to concatenate multiple variables, not just two

Answered

Hi,

so my external API function has an input of up to 4 variables that I need to combine into a single param for my API call.

I've been looking around, found 'concat' but it seems designed to concatenate only two values.

Here's the specific issue, see the following API call:

https://api.twitter.com/2/tweets/search/recent?query=indie lang:es place_country=ES -is:retweet&tweet.fields=public_metrics,text,author_id,entities,context_annotations&expansions=author_id&place.fields=id,full_name,country,country_code,place_type&user.fields=id

Param query is constructed with multiple inputs, topic, lang, place_country… separated by a whitespace

I have a variable query where I need to concatenate those inputs separated by a whitespace to pass into the API call.

I guess I could go by steps:

concatenate topic+lang, then concatenate topiclang+place… and so on.

Is it there a better way to do this?

3 replies