How do you check a string for "null" in Dart? (not a null
object)
is there some Dart SDK API like Java's equals
?
I believe isEmpty property will return false since if your string is null, it still holds an object and won't be empty. So depending on what you mean in your post.
If you want to check for the string 'null', just do
if (stringVar == 'null')
or if you want to check if your string is null, then
if (stringVar == null)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With