small addition to joinTo

This commit is contained in:
InsanusMokrassar 2021-09-02 14:01:01 +06:00
parent 662f4d22a3
commit 97fc1d6239

View File

@ -25,9 +25,23 @@ inline fun <I, R> Iterable<I>.joinTo(
return result return result
} }
inline fun <I, R> Iterable<I>.joinTo(
separator: R?,
prefix: R?,
postfix: R?,
crossinline transform: (I) -> R?
): List<R> = joinTo({ separator }, prefix, postfix, transform)
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?,
postfix: R?, postfix: R?,
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()
inline fun <I, reified R> Array<I>.joinTo(
separator: R?,
prefix: R?,
postfix: R?,
crossinline transform: (I) -> R?
): Array<R> = asIterable().joinTo(separator, prefix, postfix, transform).toTypedArray()