How to get a length of a string iOS swift?
Solution:
The below functions are used for counting the number of characters in a particular string.
If your string will be like above then
Swift 4:
yourString.count
Swift 2:
The below functions are used for counting the number of characters in a particular string.
var yourString: String = "string count"
If your string will be like above then
Swift 4:
yourString.count
Swift 2:
yourString.characters.count
Swift 1:
Count(yourString)
Count(yourString)
Comments
Post a Comment