Check if string is empty

 Problem

I want to check if a string is empty



 Recipe


// String literal
var a = "Hello World!"

// Check if it is empty

if a.isEmpty {
    print("Ooops, it's empty")
}
else {
    print("No, it's not empty")
}

				


 Playground