<div><br><div class="gmail_quote"><div dir="auto">Quinn &quot;The Eskimo!&quot; via swift-users &lt;<a href="mailto:swift-users@swift.org">swift-users@swift.org</a>&gt; schrieb am Mi. 8. Nov. 2017 um 09:56:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
On 8 Nov 2017, at 08:47, Martin R via swift-users &lt;<a href="mailto:swift-users@swift.org" target="_blank">swift-users@swift.org</a>&gt; wrote:<br>
<br>
&gt; but apparently only if Foundation is imported.<br>
<br>
Which isn’t a huge surprise when you consider how tricky string containment is.</blockquote><div dir="auto"><br></div><div dir="auto">As someone who has used Swift professionally since it first came out, this subtle API change after import actually is a surprise to me.</div><div dir="auto"><br></div><div dir="auto">Would you be able to clarify where the line is between “tricky” and “not tricky” and if possible the reasoning behind making this distinction? Because as an outsider this seems to me like an unfortunate remnant of ObjC rather than an obvious and forward-thinking API decision.</div><div dir="auto"><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
<br>
import Foundation<br>
<br>
// U+00DF LATIN SMALL LETTER SHARP S<br>
<br>
let s = &quot;Friedrichstra\u{df}e&quot;<br>
let ss = &quot;strasse&quot;<br>
if s.contains(s) {<br>
    print(&quot;It&#39;s a street!&quot;)<br>
}</blockquote><div dir="auto"><br></div><div dir="auto">In Swiss German “Straße” and “Strasse” are equivalent (or rather, the first one doesn’t officially exist). In High/“Standard” German they’re not / would be pronounced differently etc. Some Germans call the “sharp s” an “sz” instead. So the difficulty of this distinction is not restricted to Unicode :)</div><div dir="auto"><br></div><div dir="auto">Cheers,</div><div dir="auto">Geordie</div><div dir="auto"><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
<br>
Share and Enjoy<br>
--<br>
Quinn &quot;The Eskimo!&quot;                    &lt;<a href="http://www.apple.com/developer/" rel="noreferrer" target="_blank">http://www.apple.com/developer/</a>&gt;<br>
Apple Developer Relations, Developer Technical Support, Core OS/Hardware<br>
<br>
<br>
_______________________________________________<br>
swift-users mailing list<br>
<a href="mailto:swift-users@swift.org" target="_blank">swift-users@swift.org</a><br>
<a href="https://lists.swift.org/mailman/listinfo/swift-users" rel="noreferrer" target="_blank">https://lists.swift.org/mailman/listinfo/swift-users</a><br>
</blockquote></div></div>