String
struct String
-
Changes underscores to camelCase
Returns
String with all instances of_charreplaced withCharDeclaration
Swift
public var underscoreToCamelCase: StringReturn Value
String with all instances of
_charreplaced withChar -
Sets the first character in a string to uppercase.
Returns
StringDeclaration
Swift
public var uppercaseFirst: StringReturn Value
String
-
Removes white spaces from a string.
Returns
StringDeclaration
Swift
public var trim: StringReturn Value
String
-
Truncates a string and appends trailing characters if the number of characters in the string exceeds truncated length
Parameter
Parameter length: int the number of characters from the start where the trucation occurs
Parameter
Parameter trailing: string to append to the end of the turncation (if required). Defaults to
...Returns
String
Declaration
Swift
public func truncate(length: Int, trailing: String? = "...") -> StringParameters
lengthint the number of characters from the start where the trucation occurs
trailingstring to append to the end of the turncation (if required). Defaults to
...Return Value
String
-
Url encodes a string
Declaration
Swift
public var urlEncode: String -
Splits a string into an array by the given delimiter
Parameter
Parameter delimiter: string to use as the splitter
Returns
[String]
Declaration
Swift
public func split(delimiter: String) -> [String]Parameters
delimiterstring to use as the splitter
Return Value
[String]
-
Determines if a string is a valid email address
Returns
BoolDeclaration
Swift
public var isValidEmail:BoolReturn Value
Bool
-
Counts the number of charaters in a string
Returns
Int - the number of charactersDeclaration
Swift
public var count:Int { return self.characters.count }Return Value
Int - the number of characters
-
Converts a string to NSDate if possible
Parameter
Parameter format: the date format. The default is ISO
yyyy-MM-dd'T'HH:mm:ssZZZZReturns
NSDate?
Declaration
Swift
public func toDate(format:String = "yyyy-MM-dd'T'HH:mm:ssZZZZ") -> NSDate?Parameters
formatthe date format. The default is ISO
yyyy-MM-dd'T'HH:mm:ssZZZZReturn Value
NSDate?
-
Undocumented
Declaration
Swift
struct String -
Removes all html from a string
Returns
String?Declaration
Swift
public var stripHTML: String?Return Value
String?
String Extension Reference