String
extension String
-
returns the value but uppercases the first letter
Declaration
Swift
public var upperFirst: String { get }
-
returns the value but lowercases the first letter
Declaration
Swift
public var lowerFirst: String { get }
-
removes a leading
_
from the string if one existsDeclaration
Swift
public var removePrefix: String { get }
-
adds a leading
_
from the string if none existsDeclaration
Swift
public var addPrefix: String { get }
-
returns true if the type defined in this string matches the regex pattern of a primitive type in Swift
Declaration
Swift
public var isPrimitiveType: Bool { get }
-
returns true if the type defined in this string matches the regex pattern of an integer type in Swift
Declaration
Swift
public var isInteger: Bool { get }
-
returns true if the type defined in this string matches the regex pattern of a boolean type in Swift
Declaration
Swift
public var isBool: Bool { get }
-
returns true if the type defined in this string matches the regex pattern of a double type in Swift
Declaration
Swift
public var isDouble: Bool { get }
-
returns true if the type defined in this string matches the regex pattern of a string type in Swift
Declaration
Swift
public var isString: Bool { get }
-
returns true if the type defined in this string matches the regex pattern of an array type in Swift
Declaration
Swift
public var isArrayType: Bool { get }
-
returns true if the type defined in this string matches the regex pattern of a dictionary type in Swift
Declaration
Swift
public var isDictionaryType: Bool { get }
-
returns true if the type defined in this string matches the regex pattern of a collection (array or dictionary) type in Swift
Declaration
Swift
public var isCollectionType: Bool { get }
-
returns true if the type defined in this string has a trailing
?
Declaration
Swift
public var isOptional: Bool { get }
-
returns the type name without
?
if type is an optionalDeclaration
Swift
public var unwrapped: String { get }
-
returns the type name with
?
if type is not already an optionalDeclaration
Swift
public var wrapped: String { get }
-
returns the type of items inside an array
Declaration
Swift
public var itemType: String { get }