Prerelease This site documents an alpha of libtmux. Its structure, URLs and APIs are subject to change.

RegexPattern.Options.insert(_:)

Swift
  • Python Unavailable
  • Ruby Unavailable
  • Lua Unavailable
  • TypeScript Unavailable
  • Rust Unavailable
  • Go Unavailable
  • Java Unavailable
  • .NET Unavailable
  • C++ Unavailable
  • Swift

View as Markdown

Module
RegexPattern
Declared in
Options
Package
libtmux-swift
insert(_:) ( newMember : Self.Element ) → (inserted: Bool, memberAfterInsert: Self.Element)
method
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 secondDay shipping option is added to the freeOptions option set if purchasePrice is greater than 50.0. For the ShippingOptions declaration, see the OptionSet protocol 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) if newMember was not contained in self. Otherwise, returns (false, oldMember), where oldMember is the member of the set equal to newMember.

0 declared, 0 inherited

Esc

Type to search.