<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hi Dave<div class=""><br class=""></div><div class="">“true” ? am I going nuts ? :o)&nbsp;</div><div class=""><br class=""></div><div class=""><div style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo; color: rgb(209, 47, 27);" class=""><div style="margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">var</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> str = </span><span style="font-variant-ligatures: no-common-ligatures" class="">"Hello, playground"</span></div><div style="margin: 0px; line-height: normal; min-height: 19px;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""></span><br class=""></div><div style="margin: 0px; line-height: normal; color: rgb(61, 29, 129);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">print</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">( </span><span style="font-variant-ligatures: no-common-ligatures; color: #4f8187" class="">str</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">.</span><span style="font-variant-ligatures: no-common-ligatures" class="">hasPrefix</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">(</span><span style="font-variant-ligatures: no-common-ligatures; color: #d12f1b" class="">"”</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">)) // case 1 : false</span></div><div style="margin: 0px; line-height: normal; min-height: 19px;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""></span><br class=""></div><div style="margin: 0px; line-height: normal; color: rgb(61, 29, 129);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">print</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">( </span><span style="font-variant-ligatures: no-common-ligatures; color: #4f8187" class="">str</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">.</span><span style="font-variant-ligatures: no-common-ligatures" class="">hasSuffix</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">(</span><span style="font-variant-ligatures: no-common-ligatures; color: #d12f1b" class="">"”</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">)) // case 2 : false</span></div><div style="margin: 0px; line-height: normal; min-height: 19px;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""></span><br class=""></div><div style="margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #3d1d81" class="">print</span><span style="font-variant-ligatures: no-common-ligatures" class="">(</span><span style="font-variant-ligatures: no-common-ligatures;" class="">""</span><span style="font-variant-ligatures: no-common-ligatures" class=""> == </span><span style="font-variant-ligatures: no-common-ligatures;" class="">“a”&nbsp;</span><span style="font-variant-ligatures: no-common-ligatures" class="">) &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;// case 3 : false</span></div></div></div><div style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo; color: rgb(61, 29, 129);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""><br class=""></span></div><div style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo; color: rgb(61, 29, 129);" class=""><br class=""></div><div class="">Currently, all cases above evaluate to “false”</div><div class="">i think that is correct, because:</div><div class=""><br class=""></div><div class=""><div class="">How can an empty string be a prefix or suffix value?</div><div class="">as there is no empty string present in a non-empty string.&nbsp;</div></div><div class=""><br class=""></div><div class="">Note that if case 1 and case 2 would evaluate to “true”,&nbsp;</div><div class="">it would conflict with case 3.&nbsp;</div><div class=""><br class=""></div><div class="">Can’t imagine that case 3 should in future also result in “true”&nbsp;</div><div class=""><br class=""></div><div class="">??</div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">-----</div><div class=""><br class=""></div><div class="">Also I hope that changes to String functionality</div><div class="">for Swift 4 are not backward breaking changes</div><div class="">even the more for string handling, because Strings&nbsp;</div><div class="">are heavily used in most apps.&nbsp;</div><div class=""><br class=""></div><div class="">I am firmly convinced that all future releases of Swift&nbsp;</div><div class="">should compile Swift 3 and higher source files without</div><div class="">any changes 100 % flawlessly! This prevents early diminishing&nbsp;</div><div class="">of Swift’s popularity, especially with those building large</div><div class="">codebases using Swift.&nbsp;</div><div class=""><br class=""></div><div class="">I’ve started a thread about this a week ago,</div><div class="">however no one found this important enough to</div><div class="">share their opinions with me yet, or were too busy with</div><div class="">other subjects to do so.</div><div class=""><br class=""></div><div class="">Increasingly I have dreams, me</div><div class="">programming complete apps in Smalltalk</div><div class="">and then automagically generate&nbsp;</div><div class="">an macOS, tvOS or iOS runtime app of it.</div><div class=""><br class=""></div><div class="">(I have also dreams of this world becoming</div><div class="">a nice and peaceful placebut that is&nbsp;</div><div class="">beyond the context of this forum) &nbsp; &nbsp;</div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">Kind Regards</div><div class="">TedvG&nbsp;</div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><a href="http://www.speyer.de" class="">www.speyer.de</a></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">&nbsp;</div><div class=""><br class=""><blockquote type="cite" class="">on Mon Jul 18 2016, Kevin Nattinger &lt;<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>&gt; wrote:<br class=""><br class=""><blockquote type="cite" class="">I agree, true is definitely the expected behavior. In particular, it<br class="">seems absurd to me that `a.hasPrefix(b)` and `a.hasSuffix(b)` could be<br class="">false when `a == b` is true.<br class=""></blockquote><br class="">I expect to be reworking Strings for Swift 4, and this is one of the<br class="">many things we plan to address.<br class=""><br class="">--&nbsp;<br class="">Dave<br class=""><br class=""><br class=""></blockquote><div class=""><br class=""></div></div></body></html>