You can get the length of the string following way
var str: String = "string 1 " print ("Length of the string : \(str.characters.count)")
Output Length of the string : 9