• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
formatted strings in Swift
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

formatted strings in Swift


  • Subject: formatted strings in Swift
  • From: "Gerriet M. Denkmann" <email@hidden>
  • Date: Sat, 03 Sep 2016 12:02:04 +0700

Did in a playground:

let s = String(format: "%2s → %2s", "a", "b")
print(“formatted = \"\(s)\"")

But this prints random garbage (e.g.: formatted = “‡“S → ‡“S”)  (no error message or compiler warning).

Why?
How to create a formatted string?

Gerriet.


_______________________________________________

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


  • Follow-Ups:
    • Re: formatted strings in Swift
      • From: Lou Zell <email@hidden>
    • Re: formatted strings in Swift
      • From: Quincey Morris <email@hidden>
  • Prev by Date: Re: Substring in Swift
  • Next by Date: Re: formatted strings in Swift
  • Previous by thread: Re: Does setFormatter() retain?
  • Next by thread: Re: formatted strings in Swift
  • Index(es):
    • Date
    • Thread