swift check length of string code example Example: Get the length of a String swift var test1: String = "Scott" test1.count