[swift-dev] Implementing hasPrefix and hasSuffix
alex.blewitt at gmail.com
Tue Dec 22 15:28:38 CST 2015
I raised https://bugs.swift.org/browse/SR-337 <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 request for but don’t know where it should go. The current implementation is at
inside ‘StringLegacy.swift’ but I’d presume it’s better to live elsewhere.
In addition this uses the character view which I’m not sure follows the normalisation required for comparisons; or if there is some different normalisation routines that need to be written either.
Finally it’s not clear if this the right way to solve the problem, or if the implementation should be in the open-source version of the Foundation NSString implementation.
Happy to take comments by mail or on the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the swift-dev