Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public actual inline fun String?.toBoolean(): Boolean = this.equals("true", igno
/**
* Parses the string to a [Byte] number.
*
* The string must consist of an optional leading `+` or `-` sign and decimal digits (`0-9`),
* The string must consist of an optional leading `+` or `-` sign and decimal digits (like `0-9`),
* and fit the valid [Byte] value range (within `Byte.MIN_VALUE..Byte.MAX_VALUE`),
* otherwise a [NumberFormatException] will be thrown.
*
Expand All @@ -89,7 +89,7 @@ public actual inline fun String.toByte(radix: Int): Byte = toByteOrNull(radix) ?
/**
* Parses the string to a [Short] number.
*
* The string must consist of an optional leading `+` or `-` sign and decimal digits (`0-9`),
* The string must consist of an optional leading `+` or `-` sign and decimal digits (like `0-9`),
* and fit the valid [Short] value range (within `Short.MIN_VALUE..Short.MAX_VALUE`),
* otherwise a [NumberFormatException] will be thrown.
*
Expand All @@ -111,7 +111,7 @@ public actual inline fun String.toShort(radix: Int): Short = toShortOrNull(radix
/**
* Parses the string to an [Int] number.
*
* The string must consist of an optional leading `+` or `-` sign and decimal digits (`0-9`),
* The string must consist of an optional leading `+` or `-` sign and decimal digits (like `0-9`),
* and fit the valid [Int] value range (within `Int.MIN_VALUE..Int.MAX_VALUE`),
* otherwise a [NumberFormatException] will be thrown.
*
Expand All @@ -133,7 +133,7 @@ public actual inline fun String.toInt(radix: Int): Int = toIntOrNull(radix) ?: t
/**
* Parses the string to a [Long] number.
*
* The string must consist of an optional leading `+` or `-` sign and decimal digits (`0-9`),
* The string must consist of an optional leading `+` or `-` sign and decimal digits (like `0-9`),
* and fit the valid [Long] value range (within `Long.MIN_VALUE..Long.MAX_VALUE`),
* otherwise a [NumberFormatException] will be thrown.
*
Expand Down
8 changes: 4 additions & 4 deletions libraries/stdlib/common/src/kotlin/TextH.kt
Original file line number Diff line number Diff line change
Expand Up @@ -551,7 +551,7 @@ public expect fun String?.toBoolean(): Boolean
/**
* Parses the string to a [Byte] number.
*
* The string must consist of an optional leading `+` or `-` sign and decimal digits (`0-9`),
* The string must consist of an optional leading `+` or `-` sign and decimal digits (like `0-9`),
* and fit the valid [Byte] value range (within `Byte.MIN_VALUE..Byte.MAX_VALUE`),
* otherwise a [NumberFormatException] will be thrown.
*
Expand All @@ -570,7 +570,7 @@ public expect fun String.toByte(radix: Int): Byte
/**
* Parses the string to a [Short] number.
*
* The string must consist of an optional leading `+` or `-` sign and decimal digits (`0-9`),
* The string must consist of an optional leading `+` or `-` sign and decimal digits (like `0-9`),
* and fit the valid [Short] value range (within `Short.MIN_VALUE..Short.MAX_VALUE`),
* otherwise a [NumberFormatException] will be thrown.
*
Expand All @@ -589,7 +589,7 @@ public expect fun String.toShort(radix: Int): Short
/**
* Parses the string to an [Int] number.
*
* The string must consist of an optional leading `+` or `-` sign and decimal digits (`0-9`),
* The string must consist of an optional leading `+` or `-` sign and decimal digits (like `0-9`),
* and fit the valid [Int] value range (within `Int.MIN_VALUE..Int.MAX_VALUE`),
* otherwise a [NumberFormatException] will be thrown.
*
Expand All @@ -608,7 +608,7 @@ public expect fun String.toInt(radix: Int): Int
/**
* Parses the string to a [Long] number.
*
* The string must consist of an optional leading `+` or `-` sign and decimal digits (`0-9`),
* The string must consist of an optional leading `+` or `-` sign and decimal digits (like `0-9`),
* and fit the valid [Long] value range (within `Long.MIN_VALUE..Long.MAX_VALUE`),
* otherwise a [NumberFormatException] will be thrown.
*
Expand Down
8 changes: 4 additions & 4 deletions libraries/stdlib/js/src/kotlin/text/numberConversions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public actual fun String?.toBoolean(): Boolean = this != null && this.lowercase(
/**
* Parses the string to a [Byte] number.
*
* The string must consist of an optional leading `+` or `-` sign and decimal digits (`0-9`),
* The string must consist of an optional leading `+` or `-` sign and decimal digits (like `0-9`),
* and fit the valid [Byte] value range (within `Byte.MIN_VALUE..Byte.MAX_VALUE`),
* otherwise a [NumberFormatException] will be thrown.
*
Expand All @@ -40,7 +40,7 @@ public actual fun String.toByte(radix: Int): Byte = toByteOrNull(radix) ?: numbe
/**
* Parses the string to a [Short] number.
*
* The string must consist of an optional leading `+` or `-` sign and decimal digits (`0-9`),
* The string must consist of an optional leading `+` or `-` sign and decimal digits (like `0-9`),
* and fit the valid [Short] value range (within `Short.MIN_VALUE..Short.MAX_VALUE`),
* otherwise a [NumberFormatException] will be thrown.
*
Expand All @@ -59,7 +59,7 @@ public actual fun String.toShort(radix: Int): Short = toShortOrNull(radix) ?: nu
/**
* Parses the string to an [Int] number.
*
* The string must consist of an optional leading `+` or `-` sign and decimal digits (`0-9`),
* The string must consist of an optional leading `+` or `-` sign and decimal digits (like `0-9`),
* and fit the valid [Int] value range (within `Int.MIN_VALUE..Int.MAX_VALUE`),
* otherwise a [NumberFormatException] will be thrown.
*
Expand All @@ -78,7 +78,7 @@ public actual fun String.toInt(radix: Int): Int = toIntOrNull(radix) ?: numberFo
/**
* Parses the string to a [Long] number.
*
* The string must consist of an optional leading `+` or `-` sign and decimal digits (`0-9`),
* The string must consist of an optional leading `+` or `-` sign and decimal digits (like `0-9`),
* and fit the valid [Long] value range (within `Long.MIN_VALUE..Long.MAX_VALUE`),
* otherwise a [NumberFormatException] will be thrown.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public actual inline fun String?.toBoolean(): Boolean = java.lang.Boolean.parseB
/**
* Parses the string to a [Byte] number.
*
* The string must consist of an optional leading `+` or `-` sign and decimal digits (`0-9`),
* The string must consist of an optional leading `+` or `-` sign and decimal digits (like `0-9`),
* and fit the valid [Byte] value range (within `Byte.MIN_VALUE..Byte.MAX_VALUE`),
* otherwise a [NumberFormatException] will be thrown.
*
Expand All @@ -80,7 +80,7 @@ public actual inline fun String.toByte(radix: Int): Byte = java.lang.Byte.parseB
/**
* Parses the string to a [Short] number.
*
* The string must consist of an optional leading `+` or `-` sign and decimal digits (`0-9`),
* The string must consist of an optional leading `+` or `-` sign and decimal digits (like `0-9`),
* and fit the valid [Short] value range (within `Short.MIN_VALUE..Short.MAX_VALUE`),
* otherwise a [NumberFormatException] will be thrown.
*
Expand All @@ -102,7 +102,7 @@ public actual inline fun String.toShort(radix: Int): Short = java.lang.Short.par
/**
* Parses the string to an [Int] number.
*
* The string must consist of an optional leading `+` or `-` sign and decimal digits (`0-9`),
* The string must consist of an optional leading `+` or `-` sign and decimal digits (like `0-9`),
* and fit the valid [Int] value range (within `Int.MIN_VALUE..Int.MAX_VALUE`),
* otherwise a [NumberFormatException] will be thrown.
*
Expand All @@ -124,7 +124,7 @@ public actual inline fun String.toInt(radix: Int): Int = java.lang.Integer.parse
/**
* Parses the string to a [Long] number.
*
* The string must consist of an optional leading `+` or `-` sign and decimal digits (`0-9`),
* The string must consist of an optional leading `+` or `-` sign and decimal digits (like `0-9`),
* and fit the valid [Long] value range (within `Long.MIN_VALUE..Long.MAX_VALUE`),
* otherwise a [NumberFormatException] will be thrown.
*
Expand Down
8 changes: 4 additions & 4 deletions libraries/stdlib/src/kotlin/text/StringNumberConversions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ package kotlin.text
/**
* Parses the string to a [Byte] number or returns `null` if the string is not a valid representation of a [Byte].
*
* The string must consist of an optional leading `+` or `-` sign and decimal digits (`0-9`),
* The string must consist of an optional leading `+` or `-` sign and decimal digits (like `0-9`),
* and fit the valid [Byte] value range (within `Byte.MIN_VALUE..Byte.MAX_VALUE`),
* otherwise `null` is returned.
*
Expand All @@ -37,7 +37,7 @@ public fun String.toByteOrNull(radix: Int): Byte? {
/**
* Parses the string to a [Short] number or returns `null` if the string is not a valid representation of a [Short].
*
* The string must consist of an optional leading `+` or `-` sign and decimal digits (`0-9`),
* The string must consist of an optional leading `+` or `-` sign and decimal digits (like `0-9`),
* and fit the valid [Short] value range (within `Short.MIN_VALUE..Short.MAX_VALUE`),
* otherwise `null` is returned.
*
Expand All @@ -62,7 +62,7 @@ public fun String.toShortOrNull(radix: Int): Short? {
/**
* Parses the string to an [Int] number or returns `null` if the string is not a valid representation of an [Int].
*
* The string must consist of an optional leading `+` or `-` sign and decimal digits (`0-9`),
* The string must consist of an optional leading `+` or `-` sign and decimal digits (like `0-9`),
* and fit the valid [Int] value range (within `Int.MIN_VALUE..Int.MAX_VALUE`),
* otherwise `null` is returned.
*
Expand Down Expand Up @@ -142,7 +142,7 @@ public fun String.toIntOrNull(radix: Int): Int? {
/**
* Parses the string to a [Long] number or returns `null` if the string is not a valid representation of a [Long].
*
* The string must consist of an optional leading `+` or `-` sign and decimal digits (`0-9`),
* The string must consist of an optional leading `+` or `-` sign and decimal digits (like `0-9`),
* and fit the valid [Long] value range (within `Long.MIN_VALUE..Long.MAX_VALUE`),
* otherwise `null` is returned.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public actual fun String?.toBoolean(): Boolean = this != null && this.lowercase(
/**
* Parses the string to a [Byte] number.
*
* The string must consist of an optional leading `+` or `-` sign and decimal digits (`0-9`),
* The string must consist of an optional leading `+` or `-` sign and decimal digits (like `0-9`),
* and fit the valid [Byte] value range (within `Byte.MIN_VALUE..Byte.MAX_VALUE`),
* otherwise a [NumberFormatException] will be thrown.
*
Expand All @@ -36,7 +36,7 @@ public actual fun String.toByte(radix: Int): Byte = toByteOrNull(radix) ?: numbe
/**
* Parses the string to a [Short] number.
*
* The string must consist of an optional leading `+` or `-` sign and decimal digits (`0-9`),
* The string must consist of an optional leading `+` or `-` sign and decimal digits (like `0-9`),
* and fit the valid [Short] value range (within `Short.MIN_VALUE..Short.MAX_VALUE`),
* otherwise a [NumberFormatException] will be thrown.
*
Expand All @@ -55,7 +55,7 @@ public actual fun String.toShort(radix: Int): Short = toShortOrNull(radix) ?: nu
/**
* Parses the string to an [Int] number.
*
* The string must consist of an optional leading `+` or `-` sign and decimal digits (`0-9`),
* The string must consist of an optional leading `+` or `-` sign and decimal digits (like `0-9`),
* and fit the valid [Int] value range (within `Int.MIN_VALUE..Int.MAX_VALUE`),
* otherwise a [NumberFormatException] will be thrown.
*
Expand All @@ -74,7 +74,7 @@ public actual fun String.toInt(radix: Int): Int = toIntOrNull(radix) ?: numberFo
/**
* Parses the string to a [Long] number.
*
* The string must consist of an optional leading `+` or `-` sign and decimal digits (`0-9`),
* The string must consist of an optional leading `+` or `-` sign and decimal digits (like `0-9`),
* and fit the valid [Long] value range (within `Long.MIN_VALUE..Long.MAX_VALUE`),
* otherwise a [NumberFormatException] will be thrown.
*
Expand Down