<p>This example uses the <code>contains(_:)</code> method to test whether an integer is
a member of a set of prime numbers.</p>
<pre><code class="language-swift">let primes: Set = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37]
let x = 5
if primes.contains(x) {
    print(&quot;\(x) is prime!&quot;)
} else {
    print(&quot;\(x). Not prime.&quot;)
}
// Prints &quot;5 is prime!&quot;
</code></pre>
<ul>
<li>Parameter member: An element to look for in the set.</li>
</ul>
<h4>Declaration</h4><code class="language-s