small addition to joinTo

This commit is contained in:
InsanusMokrassar 2021-09-02 14:33:35 +06:00
parent 2644f27975
commit f6a06ee8ea

View File

@ -39,15 +39,15 @@ inline fun <I> Iterable<I>.joinTo(
): List<I> = joinTo<I, I>(separatorFun, prefix, postfix) { it } ): List<I> = joinTo<I, I>(separatorFun, prefix, postfix) { it }
inline fun <I> Iterable<I>.joinTo( inline fun <I> Iterable<I>.joinTo(
separator: I?, separator: I? = null,
prefix: I? = null, prefix: I? = null,
postfix: I? = null postfix: I? = null
): List<I> = joinTo<I>({ separator }, prefix, postfix) ): List<I> = joinTo<I>({ separator }, prefix, postfix)
inline fun <I, reified R> Array<I>.joinTo( inline fun <I, reified R> Array<I>.joinTo(
crossinline separatorFun: (I) -> R?, crossinline separatorFun: (I) -> R?,
prefix: R?, prefix: R? = null,
postfix: R?, postfix: R? = null,
crossinline transform: (I) -> R? crossinline transform: (I) -> R?
): Array<R> = asIterable().joinTo(separatorFun, prefix, postfix, transform).toTypedArray() ): Array<R> = asIterable().joinTo(separatorFun, prefix, postfix, transform).toTypedArray()