length of string swift code example
Example 1: Get the length of a String swift
var test1: String = "Scott"
test1.count
Example 2: number of characters in a string swift
test1.count
Example 3: find length of string in swift
let message = "Hello, World!"
// count length of a string
print(message.count) // 13Copied