range.contains()

// range.contains()
(10..<50).contains(50)    // false
(10...50).contains(50)    // true
("a"..."m").contains("giraffe")    // true

// ~= operator
10...100 ~= 50            // true: ~= means "contains"

Last updated