Is there a way to check strings for nil and \"\" in Swift? In Rails, I can use blank() to check.
nil
\"\"
blank()
I currently have this, but i
var str: String? = nil if str?.isEmpty ?? true { print("str is nil or empty") } str = "" if str?.isEmpty ?? true { print("str is nil or empty") }