From 63c5e18149316b7fa3c932b5629da3cb16ac992e Mon Sep 17 00:00:00 2001 From: Ilya Gorbunov Date: Sun, 21 Oct 2018 21:21:31 +0300 Subject: [PATCH] capitalize/decapitalize docs in stdlib/js --- libraries/stdlib/js/src/kotlin/stringsCode.kt | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/libraries/stdlib/js/src/kotlin/stringsCode.kt b/libraries/stdlib/js/src/kotlin/stringsCode.kt index 2330b18fad4..8012a902aa7 100644 --- a/libraries/stdlib/js/src/kotlin/stringsCode.kt +++ b/libraries/stdlib/js/src/kotlin/stringsCode.kt @@ -67,18 +67,20 @@ public actual fun CharSequence.regionMatches(thisOffset: Int, other: CharSequenc /** - * Returns a copy of this string capitalised if it is not empty or already starting with an uppper case letter, otherwise returns this + * Returns a copy of this string having its first letter uppercased, or the original string, + * if it's empty or already starts with an upper case letter. * - * @includeFunctionBody ../../test/StringTest.kt capitalize + * @sample samples.text.Strings.capitalize */ public actual fun String.capitalize(): String { return if (isNotEmpty()) substring(0, 1).toUpperCase() + substring(1) else this } /** - * Returns a copy of this string with the first letter lower case if it is not empty or already starting with a lower case letter, otherwise returns this + * Returns a copy of this string having its first letter lowercased, or the original string, + * if it's empty or already starts with a lower case letter. * - * @includeFunctionBody ../../test/StringTest.kt decapitalize + * @sample samples.text.Strings.decapitalize */ public actual fun String.decapitalize(): String { return if (isNotEmpty()) substring(0, 1).toLowerCase() + substring(1) else this