Check the number of letters in Swift program for beginners

Check the number of letters in Swift program for beginners. This program will print the count of the letters in swift. Here we have used the count method to print the number of letters in the user given statement in the swift programming language. By using the we can count different set of charecters in swift. The output is calculated and produced the result by count keyword in the program.

let a1 = "welcome"
let a2 = "to"
let a3 = "inlarn"
let a4 = "programming website"
print(a1.count)
print(a2.count)
print(a3.count)
print(a4.count)

Output:

7                                                                                                                               

2                                                                                                                               

6                                                                                                                               

19