String
public extension String
-
Returns
nilif string is emptyDeclaration
Swift
var nilIfEmpty: String? { get } -
Truncates a given string after the given
lengthbased on the rule set by theposition.If the string in
selfis shorter than the givenlength, it won’t be truncatedDeclaration
Swift
public func truncated(to length: Int, at position: TruncatingPosition = .lead) -> StringParameters
lengthLength of result string
positionDefines where to truncate the string, see
TruncatingPositionReturn Value
Truncated version of self
View on GitHub