Skip to main content

join

Creates a string that is composed of the provided strings joined together with the specified separator.

join(separator, listOfStrings)
# Or
join(separator, ...args)

Parameters#

  • separator: Separator used to join strings
  • listOfStrings: A list of strings that need to be joined together
  • args: String arguments that need to be joined together

Returns#

  • The composed string

Example#

# Strings as listprint(join(' ', ['apple', 'banana', 'mango'])) # prints: apple banana mango
# Strings as argsprint(join(', ', 'apple', 'banana', 'mango')) # prints: apple, banana, mango