April 2017
Intermediate to advanced
316 pages
9h 33m
English
Empty Strings can be initialized as follows:
// Initializing an Empty String var anEmptyString = "" var anotherEmptyString = String()
These two strings are both empty and equivalent to each other. To find out whether a String is empty, the isEmpty property can be used as follows:
if anEmptyString.isEmpty { print("String is empty") }
Read now
Unlock full access