Add samples for joinTo

KT-20357
This commit is contained in:
gzoritchak
2018-02-11 15:25:35 +01:00
committed by ilya-g
parent 40e3159463
commit f790635b30
11 changed files with 79 additions and 36 deletions
@@ -1135,6 +1135,8 @@ public expect inline fun <T, R> Iterable<T>.zipWithNext(transform: (a: T, b: T)
*
* If the collection could be huge, you can specify a non-negative value of [limit], in which case only the first [limit]
* elements will be appended, followed by the [truncated] string (which defaults to "...").
*
* @sample samples.collections.Collections.Transformations.joinTo
*/
public fun <T, A : Appendable> Iterable<T>.joinTo(buffer: A, separator: CharSequence = ", ", prefix: CharSequence = "", postfix: CharSequence = "", limit: Int = -1, truncated: CharSequence = "...", transform: ((T) -> CharSequence)? = null): A {
buffer.append(prefix)