Joins a list of strings together with a given separator. If given a list of strings not already in a table, this function can be used instead of table.concat for better performance.

Also available as string.join (though not provided by the Lua standard library).

See also Utility functions.


text = strjoin("sep", ...)


  • sep - A separator to insert between joined strings (string)
  • ... - A list of strings to be joined together (list)


  • text - The list of strings joined together with the given separator string (string)


strjoin(",", "alice", "bob", "carol")
-- Returns "alice,bob,carol"

strjoin(" mississippi, ", "one", "two", "three")
-- Returns "one mississippi, two mississippi, three