C-Sharp | Java | Python | Swift | GO | WPF | Ruby | Scala | F# | JavaScript | SQL | PHP | Angular | HTML
Tip: Join only places delimiters between strings, not at the start or end of the result. This is different from some loop-based approaches.
StringsHere: We merge the strings without a delimiter (by specifying an empty string) and with a delimiter (a comma string).
Python program that uses join on list
list = ["a", "b", "c"]
# Join with empty string literal.
result = "".join(list)
# Join with comma.
result2 = ",".join(list)
# Display results.
print(result)
print(result2)
Output
abc
a,b,c