StringMask
struct StringMask
extension StringMask : Equatable
Undocumented
-
Returns a Boolean value indicating whether two values are equal.
Equality is the inverse of inequality. For any values
a
andb
,a == b
implies thata != b
isfalse
.Declaration
Swift
static func == (lhs: StringMask, rhs: StringMask) -> Bool
Parameters
lhs
A value to compare.
rhs
Another value to compare.
-
Undocumented
Declaration
Swift
init(mask: String)
-
Applies the mask to a given string, and returns the masked string.
Declaration
Swift
func mask(_ text: String) -> String
Parameters
text
The string that you want to be masked.
Return Value
The masked string
-
Creates a standard mask for the length. This is a string masked to the given length. (e.g. length: 3, mask: “###” )
Declaration
Swift
static func standardMask(for length: Int) -> String
Return Value
Mask string (e.g “#####”)
-
Handles the unmasking of a string, given the mask it was initilized with
Declaration
Swift
func unmask(string: String?) -> String?
Parameters
string
The masked string.
Return Value
The unmasked string.