From cf076f3d25c206b30ccdd76e07bb207dd2043167 Mon Sep 17 00:00:00 2001 From: Ilya Gorbunov Date: Sat, 25 Nov 2017 22:02:54 +0300 Subject: [PATCH] Unify docs wording of 'trim*' functions --- libraries/stdlib/src/kotlin/text/Strings.kt | 32 ++++++++++----------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/libraries/stdlib/src/kotlin/text/Strings.kt b/libraries/stdlib/src/kotlin/text/Strings.kt index 2a94223f400..b8458b964ad 100644 --- a/libraries/stdlib/src/kotlin/text/Strings.kt +++ b/libraries/stdlib/src/kotlin/text/Strings.kt @@ -25,7 +25,7 @@ import kotlin.internal.contracts.* /** - * Returns a sub sequence of this char sequence having leading and trailing characters matching the [predicate] trimmed. + * Returns a sub sequence of this char sequence having leading and trailing characters matching the [predicate] removed. */ public inline fun CharSequence.trim(predicate: (Char) -> Boolean): CharSequence { var startIndex = 0 @@ -54,13 +54,13 @@ public inline fun CharSequence.trim(predicate: (Char) -> Boolean): CharSequence } /** - * Returns a string with leading and trailing characters matching the [predicate] trimmed. + * Returns a string having leading and trailing characters matching the [predicate] removed. */ public inline fun String.trim(predicate: (Char) -> Boolean): String = (this as CharSequence).trim(predicate).toString() /** - * Returns a sub sequence of this char sequence having leading characters matching the [predicate] trimmed. + * Returns a sub sequence of this char sequence having leading characters matching the [predicate] removed. */ public inline fun CharSequence.trimStart(predicate: (Char) -> Boolean): CharSequence { for (index in this.indices) @@ -71,13 +71,13 @@ public inline fun CharSequence.trimStart(predicate: (Char) -> Boolean): CharSequ } /** - * Returns a string with leading characters matching the [predicate] trimmed. + * Returns a string having leading characters matching the [predicate] removed. */ public inline fun String.trimStart(predicate: (Char) -> Boolean): String = (this as CharSequence).trimStart(predicate).toString() /** - * Returns a sub sequence of this char sequence having trailing characters matching the [predicate] trimmed. + * Returns a sub sequence of this char sequence having trailing characters matching the [predicate] removed. */ public inline fun CharSequence.trimEnd(predicate: (Char) -> Boolean): CharSequence { for (index in this.indices.reversed()) @@ -88,48 +88,48 @@ public inline fun CharSequence.trimEnd(predicate: (Char) -> Boolean): CharSequen } /** - * Returns a string with trailing characters matching the [predicate] trimmed. + * Returns a string having trailing characters matching the [predicate] removed. */ public inline fun String.trimEnd(predicate: (Char) -> Boolean): String = (this as CharSequence).trimEnd(predicate).toString() /** - * Returns a sub sequence of this char sequence having leading and trailing characters from the [chars] array trimmed. + * Returns a sub sequence of this char sequence having leading and trailing characters from the [chars] array removed. */ public fun CharSequence.trim(vararg chars: Char): CharSequence = trim { it in chars } /** - * Returns a string with leading and trailing characters from the [chars] array trimmed. + * Returns a string having leading and trailing characters from the [chars] array removed. */ public fun String.trim(vararg chars: Char): String = trim { it in chars } /** - * Returns a sub sequence of this char sequence having leading and trailing characters from the [chars] array trimmed. + * Returns a sub sequence of this char sequence having leading characters from the [chars] array removed. */ public fun CharSequence.trimStart(vararg chars: Char): CharSequence = trimStart { it in chars } /** - * Returns a string with leading and trailing characters from the [chars] array trimmed. + * Returns a string having leading characters from the [chars] array removed. */ public fun String.trimStart(vararg chars: Char): String = trimStart { it in chars } /** - * Returns a sub sequence of this char sequence having trailing characters from the [chars] array trimmed. + * Returns a sub sequence of this char sequence having trailing characters from the [chars] array removed. */ public fun CharSequence.trimEnd(vararg chars: Char): CharSequence = trimEnd { it in chars } /** - * Returns a string with trailing characters from the [chars] array trimmed. + * Returns a string having trailing characters from the [chars] array removed. */ public fun String.trimEnd(vararg chars: Char): String = trimEnd { it in chars } /** - * Returns a sub sequence of this char sequence having leading and trailing whitespace trimmed. + * Returns a sub sequence of this char sequence having leading and trailing whitespace removed. */ public fun CharSequence.trim(): CharSequence = trim(Char::isWhitespace) /** - * Returns a string with leading and trailing whitespace trimmed. + * Returns a string having leading and trailing whitespace removed. */ @kotlin.internal.InlineOnly public inline fun String.trim(): String = (this as CharSequence).trim().toString() @@ -140,7 +140,7 @@ public inline fun String.trim(): String = (this as CharSequence).trim().toString public fun CharSequence.trimStart(): CharSequence = trimStart(Char::isWhitespace) /** - * Returns a string with leading whitespace removed. + * Returns a string having leading whitespace removed. */ @kotlin.internal.InlineOnly public inline fun String.trimStart(): String = (this as CharSequence).trimStart().toString() @@ -151,7 +151,7 @@ public inline fun String.trimStart(): String = (this as CharSequence).trimStart( public fun CharSequence.trimEnd(): CharSequence = trimEnd(Char::isWhitespace) /** - * Returns a string with trailing whitespace removed. + * Returns a string having trailing whitespace removed. */ @kotlin.internal.InlineOnly public inline fun String.trimEnd(): String = (this as CharSequence).trimEnd().toString()