[swift-evolution] Change Request: Make myString.hasPrefix("") and myString.hasSuffix("") return true

Dmitri Gribenko gribozavr at gmail.com
Wed Jul 20 15:10:58 CDT 2016


On Mon, Jul 18, 2016 at 3:29 PM, Dave Abrahams via swift-evolution
<swift-evolution at swift.org> wrote:
>
> on Mon Jul 18 2016, Kevin Nattinger <swift-evolution at swift.org> wrote:
>
>> I agree, true is definitely the expected behavior. In particular, it
>> seems absurd to me that `a.hasPrefix(b)` and `a.hasSuffix(b)` could be
>> false when `a == b` is true.
>
> I expect to be reworking Strings for Swift 4, and this is one of the
> many things we plan to address.

Why not implement the change right now so that we change the semantics
in Swift 3 rather than in Swift 4?

Dmitri

-- 
main(i,j){for(i=2;;i++){for(j=2;j<i;j++){if(!(i%j)){j=0;break;}}if
(j){printf("%d\n",i);}}} /*Dmitri Gribenko <gribozavr at gmail.com>*/


More information about the swift-evolution mailing list