On this page
RegexPattern.Options.remove(_:)
- Module
- RegexPattern
- Declared in
- Options
- Package
- libtmux-swift
-
Removes the given element and all elements subsumed by it.
In the following example, the
priorityshipping option is removed from theoptionsoption set. Attempting to remove the same shipping option a second time results innil, becauseoptionsno longer containspriorityas a member.var options: ShippingOptions = [.secondDay, .priority] let priorityOption = options.remove(.priority) print(priorityOption == .priority) // Prints "true"
print(options.remove(.priority)) // Prints "nil"
In the next example, the
expresselement is passed toremove(_:). Althoughexpressis not a member ofoptions,expresssubsumes the remainingsecondDayelement of the option set. Therefore,optionsis emptied and the intersection betweenexpressandoptionsis returned.let expressOption = options.remove(.express) print(expressOption == .express) // Prints "false" print(expressOption == .secondDay) // Prints "true"
- Parameter member: The element of the set to remove.
- Returns: The intersection of
[member]and the set, if the intersection was nonempty; otherwise,nil.
0 declared, 0 inherited