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.


    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)


Comments

Popular posts from this blog

Invalid bundle error while upload the app to the app Store

Convert NsNumber, NSDate to String in iOS Swift

Global LocationManager Singleton class iOS Swift