RegexPattern.Options.insert(_:)
Swift
- Python Unavailable
- Ruby Unavailable
- Lua Unavailable
- TypeScript Unavailable
- Rust Unavailable
- Go Unavailable
- Java Unavailable
- .NET Unavailable
- C++ Unavailable
- Swift
- Module
- RegexPattern
- Declared in
- Options
- Package
- libtmux-swift
- method ¶insert(_:)
-
Inherited from
OptionSet.insert(_:)Adds the given element to the option set if it is not already a member.
In the following example, the
secondDayshipping option is added to thefreeOptionsoption set ifpurchasePriceis greater than 50.0. For theShippingOptionsdeclaration, see theOptionSetprotocol discussion.let purchasePrice = 87.55
var freeOptions: ShippingOptions = [.standard, .priority] if purchasePrice > 50 { freeOptions.insert(.secondDay) } print(freeOptions.contains(.secondDay)) // Prints "true"
- Parameter newMember: The element to insert.
- Returns:
(true, newMember)ifnewMemberwas not contained inself. Otherwise, returns(false, oldMember), whereoldMemberis the member of the set equal tonewMember.
0 declared, 0 inherited