Instance Propertyswift 6.1.2Swift

count

The number of characters in a string.

var count: Int { get }

To check whether a string is empty, use its isEmpty property instead of comparing count to zero.