# join

open fun join(separator: String, objects: Array<Any>): String(source)

Creates a string with `toString()` of each object with the given separator.

    expect:
    join(",", new Object[]{"a"}) == "a"
    join(",", new Object[]{"a", "b", "c"}) == "a,b,c"
    join(",", new Object[]{}) == ""

Content copied to clipboard
The `separator` must not be null and `objects` must not be null.

#### Return

The joined string

#### Parameters

separator

The string by which to join each string representation

objects

The objects to join the string representations of

open fun join(separator: String, objects: Iterable<out Any>): String(source)

Creates a string with `toString()` of each object with the given separator.

    expect:
    join(",", ["a"]) == "a"
    join(",", ["a", "b", "c"]) == "a,b,c"
    join(",", []) == ""

Content copied to clipboard
The `separator` must not be null and `objects` must not be null.

#### Return

The joined string

#### Parameters

separator

The string by which to join each string representation

objects

The objects to join the string representations of