let valuesArray = ["ab","bc","cd"]
valuesArray.contains(str) // -> Bool
More Related Contents:
- How to compare one value against multiple values – Swift
- Swift 2 – Pattern matching in “if”
- Swift: guard let vs if let
- What enables SwiftUI’s DSL?
- Flatten an Array of Arrays in Swift
- Real time NSTask output to NSTextView with Swift
- When are argument labels required in Swift?
- How do I detect if an SKSpriteNode has been touched
- How to set layer cornerRadius for only bottom-left, bottom-right, and top-left corner?
- Dictionary in Swift with Mutable Array as value is performing very slow? How to optimize or construct properly?
- Deleting a Row from a UITableView in Swift?
- Calculate age from birth date using NSDateComponents in Swift
- Is there a way to reset the app between tests in Swift XCTest UI?
- Keep window always on top?
- Swift: Is it possible to add a protocol extension to a protocol?
- Swift – Extra Argument in call
- CocoaPods and Carthage
- Inout parameter in async callback does not work as expected
- Swift: Converting a string into a variable name
- Selecting global or object print function
- Whither dispatch_once in Swift 3?
- NSAttributedString, change the font overall BUT keep all other attributes?
- Swift 5 : What’s ‘Escaping closure captures mutating ‘self’ parameter’ and how to fix it
- Passing data between tab viewed controllers in swift?
- Swift running sum
- Xcode 8 does full project rebuild
- What is Content in SwiftUI?
- URLSession.shared.dataTaskPublisher not working on IOS 13.3
- Swift compiler segmentation fault when building
- SwiftUI add inverted mask