Add samples for joinToString
KT-20357
This commit is contained in:
@@ -13502,6 +13502,12 @@ 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 {
|
||||
return joinTo(StringBuilder(), separator, prefix, postfix, limit, truncated, transform).toString()
|
||||
@@ -13512,6 +13518,12 @@ 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 {
|
||||
return joinTo(StringBuilder(), separator, prefix, postfix, limit, truncated, transform).toString()
|
||||
@@ -13522,6 +13534,12 @@ 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 {
|
||||
return joinTo(StringBuilder(), separator, prefix, postfix, limit, truncated, transform).toString()
|
||||
@@ -13532,6 +13550,12 @@ 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 {
|
||||
return joinTo(StringBuilder(), separator, prefix, postfix, limit, truncated, transform).toString()
|
||||
@@ -13542,6 +13566,12 @@ 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 {
|
||||
return joinTo(StringBuilder(), separator, prefix, postfix, limit, truncated, transform).toString()
|
||||
@@ -13552,6 +13582,12 @@ 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 {
|
||||
return joinTo(StringBuilder(), separator, prefix, postfix, limit, truncated, transform).toString()
|
||||
@@ -13562,6 +13598,12 @@ 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 {
|
||||
return joinTo(StringBuilder(), separator, prefix, postfix, limit, truncated, transform).toString()
|
||||
@@ -13572,6 +13614,12 @@ 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 {
|
||||
return joinTo(StringBuilder(), separator, prefix, postfix, limit, truncated, transform).toString()
|
||||
@@ -13582,6 +13630,8 @@ public fun BooleanArray.joinToString(separator: CharSequence = ", ", prefix: Cha
|
||||
*
|
||||
* 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 CharArray.joinToString(separator: CharSequence = ", ", prefix: CharSequence = "", postfix: CharSequence = "", limit: Int = -1, truncated: CharSequence = "...", transform: ((Char) -> CharSequence)? = null): String {
|
||||
return joinTo(StringBuilder(), separator, prefix, postfix, limit, truncated, transform).toString()
|
||||
|
||||
@@ -2191,6 +2191,8 @@ 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()
|
||||
|
||||
@@ -1670,8 +1670,12 @@ public fun <T, A : Appendable> Sequence<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
|
||||
*
|
||||
* 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