What method do I call to find the number of spaces in a string in Swift? I want to loop through that number, something like this:
@IBOutlet weak var stack: U
Another way could be the implementation of the following function :
func nbSpacesIn(_ word: String) -> Int { return String(word.unicodeScalars.filter({$0.value == 32})).count}