Check empty string in Swift?

There is now the built in ability to detect empty string with .isEmpty:

if emptyString.isEmpty {
    print("Nothing to see here")
}

Apple Pre-release documentation: “Strings and Characters”.

Leave a Comment