String

extension String
  • Returns the matches of a NSRegularExpression on a string

    Declaration

    Swift

    public func matchingStrings(regex: NSRegularExpression) -> [[String]]

    Parameters

    regex

    NSRegularExpression to match

    Return Value

    [[String]], the outer array contains an entry for each match and the inner arrays contain an entry for each capturing group

  • Parses a string into a Decimal, while determining how many decimal places the string contained

    Declaration

    Swift

    public func amountDecimal() -> (Decimal, Int)

    Return Value

    Tuple with the decimal and the number of decimal places the string contained