String

struct String
  • Clears cache of regular expressions.

    Declaration

    Swift

    @available(* 0.0.4, *)
    public static func clearRegexCache()
  • Returns matches for given regex in this string.

    Throws

    NSError if regex is malformed.

    Declaration

    Swift

    public func matches(for pattern: String) throws -> [String]

    Parameters

    pattern

    Pattern to match in this string.

    Return Value

    Matches for given regex in this string.

  • Returns resulting string after removing occurrences of given substring from this string.

    Declaration

    Swift

    public func removing(_ target: String) -> String

    Parameters

    target

    Substring to be removed from this string.

    Return Value

    Resulting string.

  • Returns resulting string after removing occurrences of given substrings from this string.

    Declaration

    Swift

    public func removing(_ targets: [String]) -> String

    Parameters

    targets

    Substrings to be removed from this string.

    Return Value

    Resulting string.

  • Returns a trimmed version of this string.

    Declaration

    Swift

    public var trimmed: String { get }