[swift-dev] Fwd: [swift-users] hasSuffix(_:) and .hasPrefix(_:) String methods missing on Linux

Alex Blewitt alex.blewitt at gmail.com
Fri Dec 11 06:05:15 CST 2015


There’s a FIXME and a radar (18878343) in the source for StringLegacy:

https://github.com/apple/swift/blob/master/stdlib/public/core/StringLegacy.swift#L98

Can the information be re-created as a SwiftBug instead? 

Alex

> Begin forwarded message:
> 
> From: Alex Blewitt <alex.blewitt at gmail.com>
> Subject: Re: [swift-users] hasSuffix(_:) and .hasPrefix(_:) String methods missing on Linux
> Date: 11 December 2015 11:48:02 GMT
> To: Alessandro Morgantini <gpz500 at technologist.com>
> Cc: swift-users at swift.org
> 
> They may come as extensions from NSString, which Swift doesn’t have fully implemented on Linux yet.
> 
> Alex
> 
>> On 11 Dec 2015, at 11:18, Alessandro Morgantini via swift-users <swift-users at swift.org <mailto:swift-users at swift.org>> wrote:
>> 
>> Hello to everyone!
>> I'm a very newbie to Swift, I'm doing first experiments on Linux & Mac and I have the following issue: if I call the hasSuffix(_:) or the hasPrefix(_:) methods on a String instance, I obtain the following error:
>> 
>> $ swiftc prova.swift
>> prova.swift:110:4: error: value of type 'String' has no member 'hasSuffix'
>> if pippo.hasSuffix("ao") {
>>    ^~~~~ ~~~~~~~~~
>> 
>> Same code works well on OS X.
>> I'm using Ubuntu 14.04 with required dependencies (clang and libicu-dev) installed.
>> Any idea?
>> 
>> Cheers, Alessandro
>> 
>> -- 
>> Ing. Alessandro Morgantini - http://www.morgantini.org/ <http://www.morgantini.org/>
>> Email: gpz500 at technologist.com <mailto:gpz500 at technologist.com>
>> Cell.: +39-347 761 1221 - Fax: +39-390 347 761 1221
>>  _______________________________________________
>> swift-users mailing list
>> swift-users at swift.org <mailto:swift-users at swift.org>
>> https://lists.swift.org/mailman/listinfo/swift-users
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-dev/attachments/20151211/a0c1ac4f/attachment.html>


More information about the swift-dev mailing list