[stdlib] Improve documentation of Char.isWhitespace and test it behaves the same in different targets

This commit is contained in:
Ilya Gorbunov
2024-02-19 22:23:23 +01:00
committed by Space Team
parent baca742a31
commit 709076acc9
6 changed files with 38 additions and 5 deletions
+6 -1
View File
@@ -335,7 +335,12 @@ public expect fun Char.isTitleCase(): Boolean
public expect fun Char.isISOControl(): Boolean
/**
* Determines whether a character is whitespace according to the Unicode standard.
* Determines whether a character is whitespace.
*
* A character is considered whitespace if either its Unicode [category][Char.category]
* is one of [CharCategory.SPACE_SEPARATOR], [CharCategory.LINE_SEPARATOR], [CharCategory.PARAGRAPH_SEPARATOR],
* or it is a [CharCategory.CONTROL] character in range `U+0009..U+000D` or `U+001C..U+001F`.
*
* Returns `true` if the character is whitespace.
*
* @sample samples.text.Chars.isWhitespace
+1 -1
View File
@@ -304,7 +304,7 @@ public inline fun CharSequence.isEmpty(): Boolean = length == 0
public inline fun CharSequence.isNotEmpty(): Boolean = length > 0
/**
* Returns `true` if this char sequence is empty or consists solely of whitespace characters.
* Returns `true` if this char sequence is empty or consists solely of whitespace characters according to [Char.isWhitespace].
*
* @sample samples.text.Strings.stringIsBlank
*/