Logo

Programming-Idioms

History of Idiom 110 > diff from v77 to v78

Edit summary for version 78 by AlfRichter:
[Kotlin] Update demo with better example string

Version 77

2022-02-01, 23:51:03

Version 78

2022-02-01, 23:52:16

Idiom #110 Check if string is blank

Set the boolean blank to true if the string s is empty, or null, or contains only whitespace ; false otherwise.

Idiom #110 Check if string is blank

Set the boolean blank to true if the string s is empty, or null, or contains only whitespace ; false otherwise.

Code
val blank = s.isNullOrBlank()
Code
val blank = s.isNullOrBlank()
Doc URL
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.text/is-null-or-blank.html
Doc URL
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.text/is-null-or-blank.html
Demo URL
https://pl.kotl.in/QcrAf5cM1
Demo URL
https://pl.kotl.in/tsxhJi3cW