Re: [swift-dev] Implementing hasPrefix and hasSuffix

2015-12-23 Thread Kevin Ballard via swift-dev
I'm pretty sure the current implementation uses Unicode canonical equivalence to perform the comparison. This is equivalent to invoking `decomposedStringWithCanonicalMapping` on both strings and then comparing the resulting utf8 (or utf16) sequences, although it doesn't actually build new strings.

[swift-dev] Implementing hasPrefix and hasSuffix

2015-12-22 Thread Alex Blewitt via swift-dev
I raised https://bugs.swift.org/browse/SR-337 to implement hasPrefix and hasSuffix in Swift (instead of depending on the Objective-C implementation and only being available for OSX at present. I have an implementation which I’d like to create a pull reques