String

extension String
  • Returns a String with the first match of the regular expression

    Declaration

    Swift

    public func firstMatchOfPattern(_ pattern: String) -> String?

    Parameters

    pattern

    A valid Regexp pattern

    Return Value

    nil if the pattern is invalid or not found. A String with the first match of the pattern if there is at least one match.

  • Parses a string that contains a date in ISO8601 format

    The format is the one used by git: 2019-11-18 10:48:43 +0100

    Declaration

    Swift

    public func getTimeIntervalFromISODate() -> TimeInterval?

    Return Value

    The date representation as TimeInterval since 1970 or nil if the date couldn’t be parsed