UDFS : Can UDFs take a variable number of arguments?

Can UDFs take a variable number of arguments?

I want to write a UDF called CONCAT_WS, which takes a list of strings
and combines them using a specified separator.