Add samples for joinTo
KT-20357
This commit is contained in:
@@ -13298,6 +13298,8 @@ public inline fun <V> CharArray.zip(other: CharArray, transform: (a: Char, b: Ch
|
||||
*
|
||||
* 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> Array<out T>.joinTo(buffer: A, separator: CharSequence = ", ", prefix: CharSequence = "", postfix: CharSequence = "", limit: Int = -1, truncated: CharSequence = "...", transform: ((T) -> CharSequence)? = null): A {
|
||||
buffer.append(prefix)
|
||||
@@ -13318,6 +13320,8 @@ public fun <T, A : Appendable> Array<out T>.joinTo(buffer: A, separator: CharSeq
|
||||
*
|
||||
* 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 <A : Appendable> ByteArray.joinTo(buffer: A, separator: CharSequence = ", ", prefix: CharSequence = "", postfix: CharSequence = "", limit: Int = -1, truncated: CharSequence = "...", transform: ((Byte) -> CharSequence)? = null): A {
|
||||
buffer.append(prefix)
|
||||
@@ -13341,6 +13345,8 @@ public fun <A : Appendable> ByteArray.joinTo(buffer: A, separator: CharSequence
|
||||
*
|
||||
* 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 <A : Appendable> ShortArray.joinTo(buffer: A, separator: CharSequence = ", ", prefix: CharSequence = "", postfix: CharSequence = "", limit: Int = -1, truncated: CharSequence = "...", transform: ((Short) -> CharSequence)? = null): A {
|
||||
buffer.append(prefix)
|
||||
@@ -13364,6 +13370,8 @@ public fun <A : Appendable> ShortArray.joinTo(buffer: A, separator: CharSequence
|
||||
*
|
||||
* 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 <A : Appendable> IntArray.joinTo(buffer: A, separator: CharSequence = ", ", prefix: CharSequence = "", postfix: CharSequence = "", limit: Int = -1, truncated: CharSequence = "...", transform: ((Int) -> CharSequence)? = null): A {
|
||||
buffer.append(prefix)
|
||||
@@ -13387,6 +13395,8 @@ public fun <A : Appendable> IntArray.joinTo(buffer: A, separator: CharSequence =
|
||||
*
|
||||
* 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 <A : Appendable> LongArray.joinTo(buffer: A, separator: CharSequence = ", ", prefix: CharSequence = "", postfix: CharSequence = "", limit: Int = -1, truncated: CharSequence = "...", transform: ((Long) -> CharSequence)? = null): A {
|
||||
buffer.append(prefix)
|
||||
@@ -13410,6 +13420,8 @@ public fun <A : Appendable> LongArray.joinTo(buffer: A, separator: CharSequence
|
||||
*
|
||||
* 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 <A : Appendable> FloatArray.joinTo(buffer: A, separator: CharSequence = ", ", prefix: CharSequence = "", postfix: CharSequence = "", limit: Int = -1, truncated: CharSequence = "...", transform: ((Float) -> CharSequence)? = null): A {
|
||||
buffer.append(prefix)
|
||||
@@ -13433,6 +13445,8 @@ public fun <A : Appendable> FloatArray.joinTo(buffer: A, separator: CharSequence
|
||||
*
|
||||
* 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 <A : Appendable> DoubleArray.joinTo(buffer: A, separator: CharSequence = ", ", prefix: CharSequence = "", postfix: CharSequence = "", limit: Int = -1, truncated: CharSequence = "...", transform: ((Double) -> CharSequence)? = null): A {
|
||||
buffer.append(prefix)
|
||||
@@ -13456,6 +13470,8 @@ public fun <A : Appendable> DoubleArray.joinTo(buffer: A, separator: CharSequenc
|
||||
*
|
||||
* 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 <A : Appendable> BooleanArray.joinTo(buffer: A, separator: CharSequence = ", ", prefix: CharSequence = "", postfix: CharSequence = "", limit: Int = -1, truncated: CharSequence = "...", transform: ((Boolean) -> CharSequence)? = null): A {
|
||||
buffer.append(prefix)
|
||||
@@ -13479,6 +13495,8 @@ public fun <A : Appendable> BooleanArray.joinTo(buffer: A, separator: CharSequen
|
||||
*
|
||||
* 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 <A : Appendable> CharArray.joinTo(buffer: A, separator: CharSequence = ", ", prefix: CharSequence = "", postfix: CharSequence = "", limit: Int = -1, truncated: CharSequence = "...", transform: ((Char) -> CharSequence)? = null): A {
|
||||
buffer.append(prefix)
|
||||
@@ -13502,11 +13520,7 @@ public fun <A : Appendable> CharArray.joinTo(buffer: A, separator: CharSequence
|
||||
*
|
||||
* 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 "...").
|
||||
<<<<<<< HEAD
|
||||
*
|
||||
=======
|
||||
*
|
||||
>>>>>>> b371fcfd5d9... Add samples for joinToString
|
||||
* @sample samples.collections.Collections.Transformations.joinToString
|
||||
*/
|
||||
public fun <T> Array<out T>.joinToString(separator: CharSequence = ", ", prefix: CharSequence = "", postfix: CharSequence = "", limit: Int = -1, truncated: CharSequence = "...", transform: ((T) -> CharSequence)? = null): String {
|
||||
@@ -13518,11 +13532,7 @@ public fun <T> Array<out T>.joinToString(separator: CharSequence = ", ", prefix:
|
||||
*
|
||||
* 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 "...").
|
||||
<<<<<<< HEAD
|
||||
*
|
||||
=======
|
||||
*
|
||||
>>>>>>> b371fcfd5d9... Add samples for joinToString
|
||||
* @sample samples.collections.Collections.Transformations.joinToString
|
||||
*/
|
||||
public fun ByteArray.joinToString(separator: CharSequence = ", ", prefix: CharSequence = "", postfix: CharSequence = "", limit: Int = -1, truncated: CharSequence = "...", transform: ((Byte) -> CharSequence)? = null): String {
|
||||
@@ -13534,11 +13544,7 @@ public fun ByteArray.joinToString(separator: CharSequence = ", ", prefix: CharSe
|
||||
*
|
||||
* 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 "...").
|
||||
<<<<<<< HEAD
|
||||
*
|
||||
=======
|
||||
*
|
||||
>>>>>>> b371fcfd5d9... Add samples for joinToString
|
||||
* @sample samples.collections.Collections.Transformations.joinToString
|
||||
*/
|
||||
public fun ShortArray.joinToString(separator: CharSequence = ", ", prefix: CharSequence = "", postfix: CharSequence = "", limit: Int = -1, truncated: CharSequence = "...", transform: ((Short) -> CharSequence)? = null): String {
|
||||
@@ -13550,11 +13556,7 @@ public fun ShortArray.joinToString(separator: CharSequence = ", ", prefix: CharS
|
||||
*
|
||||
* 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 "...").
|
||||
<<<<<<< HEAD
|
||||
*
|
||||
=======
|
||||
*
|
||||
>>>>>>> b371fcfd5d9... Add samples for joinToString
|
||||
* @sample samples.collections.Collections.Transformations.joinToString
|
||||
*/
|
||||
public fun IntArray.joinToString(separator: CharSequence = ", ", prefix: CharSequence = "", postfix: CharSequence = "", limit: Int = -1, truncated: CharSequence = "...", transform: ((Int) -> CharSequence)? = null): String {
|
||||
@@ -13566,11 +13568,7 @@ public fun IntArray.joinToString(separator: CharSequence = ", ", prefix: CharSeq
|
||||
*
|
||||
* 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 "...").
|
||||
<<<<<<< HEAD
|
||||
*
|
||||
=======
|
||||
*
|
||||
>>>>>>> b371fcfd5d9... Add samples for joinToString
|
||||
* @sample samples.collections.Collections.Transformations.joinToString
|
||||
*/
|
||||
public fun LongArray.joinToString(separator: CharSequence = ", ", prefix: CharSequence = "", postfix: CharSequence = "", limit: Int = -1, truncated: CharSequence = "...", transform: ((Long) -> CharSequence)? = null): String {
|
||||
@@ -13582,11 +13580,7 @@ public fun LongArray.joinToString(separator: CharSequence = ", ", prefix: CharSe
|
||||
*
|
||||
* 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 "...").
|
||||
<<<<<<< HEAD
|
||||
*
|
||||
=======
|
||||
*
|
||||
>>>>>>> b371fcfd5d9... Add samples for joinToString
|
||||
* @sample samples.collections.Collections.Transformations.joinToString
|
||||
*/
|
||||
public fun FloatArray.joinToString(separator: CharSequence = ", ", prefix: CharSequence = "", postfix: CharSequence = "", limit: Int = -1, truncated: CharSequence = "...", transform: ((Float) -> CharSequence)? = null): String {
|
||||
@@ -13598,11 +13592,7 @@ public fun FloatArray.joinToString(separator: CharSequence = ", ", prefix: CharS
|
||||
*
|
||||
* 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 "...").
|
||||
<<<<<<< HEAD
|
||||
*
|
||||
=======
|
||||
*
|
||||
>>>>>>> b371fcfd5d9... Add samples for joinToString
|
||||
* @sample samples.collections.Collections.Transformations.joinToString
|
||||
*/
|
||||
public fun DoubleArray.joinToString(separator: CharSequence = ", ", prefix: CharSequence = "", postfix: CharSequence = "", limit: Int = -1, truncated: CharSequence = "...", transform: ((Double) -> CharSequence)? = null): String {
|
||||
@@ -13614,11 +13604,7 @@ public fun DoubleArray.joinToString(separator: CharSequence = ", ", prefix: Char
|
||||
*
|
||||
* 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 "...").
|
||||
<<<<<<< HEAD
|
||||
*
|
||||
=======
|
||||
*
|
||||
>>>>>>> b371fcfd5d9... Add samples for joinToString
|
||||
* @sample samples.collections.Collections.Transformations.joinToString
|
||||
*/
|
||||
public fun BooleanArray.joinToString(separator: CharSequence = ", ", prefix: CharSequence = "", postfix: CharSequence = "", limit: Int = -1, truncated: CharSequence = "...", transform: ((Boolean) -> CharSequence)? = null): String {
|
||||
|
||||
@@ -2171,6 +2171,8 @@ public inline fun <T, R> Iterable<T>.zipWithNext(transform: (a: T, b: T) -> R):
|
||||
*
|
||||
* 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)
|
||||
@@ -2191,8 +2193,6 @@ public fun <T, A : Appendable> Iterable<T>.joinTo(buffer: A, separator: CharSequ
|
||||
*
|
||||
* 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.joinToString
|
||||
*/
|
||||
public fun <T> Iterable<T>.joinToString(separator: CharSequence = ", ", prefix: CharSequence = "", postfix: CharSequence = "", limit: Int = -1, truncated: CharSequence = "...", transform: ((T) -> CharSequence)? = null): String {
|
||||
return joinTo(StringBuilder(), separator, prefix, postfix, limit, truncated, transform).toString()
|
||||
|
||||
@@ -1648,6 +1648,8 @@ public fun <T, R> Sequence<T>.zipWithNext(transform: (a: T, b: T) -> R): Sequenc
|
||||
*
|
||||
* 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
|
||||
*
|
||||
* The operation is _terminal_.
|
||||
*/
|
||||
@@ -1674,8 +1676,6 @@ public fun <T, A : Appendable> Sequence<T>.joinTo(buffer: A, separator: CharSequ
|
||||
* @sample samples.collections.Collections.Transformations.joinToString
|
||||
*
|
||||
* The operation is _terminal_.
|
||||
*
|
||||
* @sample samples.collections.Collections.Transformations.joinToString
|
||||
*/
|
||||
public fun <T> Sequence<T>.joinToString(separator: CharSequence = ", ", prefix: CharSequence = "", postfix: CharSequence = "", limit: Int = -1, truncated: CharSequence = "...", transform: ((T) -> CharSequence)? = null): String {
|
||||
return joinTo(StringBuilder(), separator, prefix, postfix, limit, truncated, transform).toString()
|
||||
|
||||
Reference in New Issue
Block a user