The joined() method returns a new string with the given elements joined with the specified delimiter.
Example
joined() Syntax
The syntax of joined() is:
string.joined(separator: delimiter)
Here, string is an object of the String class.
joined() Parameter
The joined() method takes one parameter:
- delimiter - the delimiter to be joined with the elements
Note: If we call joined() without any parameter, the strings are joined without any separator.
joined() Return Value
- returns the joined string
Example: Swift joined()
Output
SwiftJavaJavaScript Swift Java JavaScript Swift, Java, JavaScript