Re: Swift: How to determine if a Character represents whitespace?
Re: Swift: How to determine if a Character represents whitespace?
- Subject: Re: Swift: How to determine if a Character represents whitespace?
- From: Ken Thomases <email@hidden>
- Date: Thu, 02 Apr 2015 07:44:42 -0500
On Apr 2, 2015, at 6:54 AM, Charles Jenkins <email@hidden> wrote:
> What would be nice is a way to count leading and trailing characters in place while the thing is still an NSAttributedString--without using NSAttributedString.string to convert to a Swift string in the first place.
NSAttributedString.string does not involve a conversion. The underlying string is part of NSAttributedString's data model. The documentation for the method explicitly says, "For performance reasons, this property returns the current backing store of the attributed string object."
I don't know if there's a conversion to create a Swift string from that, but you don't have to. I believe you can work with NSString in Swift.
Regards,
Ken
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden