Re: formatted strings in Swift
Re: formatted strings in Swift
- Subject: Re: formatted strings in Swift
- From: Lou Zell <email@hidden>
- Date: Sat, 03 Sep 2016 09:15:16 -0700
On Fri, Sep 2, 2016 at 10:02 PM, Gerriet M. Denkmann <email@hidden>
wrote:
>
> How to create a formatted string?
>
I use a little helper workaround that essentially looks like this:
let str = "hi".nulTerminatedUTF8
let padded = str.withUnsafeBufferPointer() {
return String(format: "s", $0.baseAddress!)
}
print(padded)
// prints: hi
_______________________________________________
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