Determines whether a character is whitespace according to the Unicode standard. Returns true
if the character is whitespace.
Since Kotlin
1.0Samples
import java.util.*
import kotlin.test.*
fun main() {
val chars = listOf(' ', '\t', '\n', '1', 'a', '\u00A0')
val (whitespaces, notWhitespaces) = chars.partition { it.isWhitespace() }
println(whitespaces.map(Char::code))
println(notWhitespaces)
}
Target: JVMRunning on v.2.1.20
Determines whether a character is whitespace according to the Unicode standard. Returns true
if the character is whitespace.
Since Kotlin
1.1Samples
import java.util.*
import kotlin.test.*
fun main() {
val chars = listOf(' ', '\t', '\n', '1', 'a', '\u00A0')
val (whitespaces, notWhitespaces) = chars.partition { it.isWhitespace() }
println(whitespaces.map(Char::code))
println(notWhitespaces)
}
Target: JVMRunning on v.2.1.20
Determines whether a character is whitespace according to the Unicode standard. Returns true
if the character is whitespace.
Since Kotlin
1.0Samples
import java.util.*
import kotlin.test.*
fun main() {
val chars = listOf(' ', '\t', '\n', '1', 'a', '\u00A0')
val (whitespaces, notWhitespaces) = chars.partition { it.isWhitespace() }
println(whitespaces.map(Char::code))
println(notWhitespaces)
}
Target: JVMRunning on v.2.1.20
Determines whether a character is whitespace according to the Unicode standard. Returns true
if the character is whitespace.
Since Kotlin
1.3Samples
import java.util.*
import kotlin.test.*
fun main() {
val chars = listOf(' ', '\t', '\n', '1', 'a', '\u00A0')
val (whitespaces, notWhitespaces) = chars.partition { it.isWhitespace() }
println(whitespaces.map(Char::code))
println(notWhitespaces)
}
Target: JVMRunning on v.2.1.20