I want check value of my EditText in 和roid so I saw two function for my String value :
user.isNullOrBlank()
和
user.isNullOrEmpty()
what is difference between them?
I want check value of my EditText in 和roid so I saw two function for my String value :
user.isNullOrBlank()
和
user.isNullOrEmpty()
what is difference between them?
isNullOrBlank()
将空格考虑在内:
fun main() {
val thisIsBlank = " "
println(thisIsBlank.isNullOrEmpty())
println(thisIsBlank.isNullOrBlank())
}
这张照片是:
false
true
because thisIsBlank
is not empty, but it is blank.