cannot convert value of type 'String' to type 'NSString' in coercion when i use self swift2 with ubuntu 16.04
<p>i have a problem with a code that throw the next message:</p>

<pre><code>error: cannot convert value of type 'String' to type 'NSString' in coercion
            return (self as NSString).substringWithRange(range)
</code></pre>

<p>I could resolve it before but not with a self calling, so here is the code:</p>

<pre><code>let range = expression.rangeOfFirstMatchInString(self, options: [], range: NSMakeRange(0, self.utf16.count))
    if range.location != NSNotFound {
        return (self as NSString).substringWithRange(range)
    }
    return nil
</code></pre>