Swift find if a String.Index is undefined : <p>I want to find if my variable midPoint is undefined. Unfortunately the following will not compile</p>

<pre><code>let midPoint : String.Index
if (typeof midPoint === "undefined" )
    {print ("undefined")}
</code></pre>

<blockquote>
  <p>typeof</p>
</blockquote>

<p>does not work, and neither does </p>

<blockquote>
  <p>type</p>
</blockquote>
