• 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
Re: NSString format specifiers (was: Is Concatenation that complex?)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSString format specifiers (was: Is Concatenation that complex?)


  • Subject: Re: NSString format specifiers (was: Is Concatenation that complex?)
  • From: Gwynne <email@hidden>
  • Date: Wed, 28 Apr 2004 00:14:36 -0400

On Apr 27, 2004, at 11:45 PM, Allan Odgaard wrote:
That's supported by stdlib as well. You can do some pretty darn neat things with stuff like %*.*f [...]
I think you mistook my stated "argument re-ordering" for "length-adjusted output" with the length optionally given as an argument (in lack of more formal terminology ;) ).

E.g. is there any way you can provide the missing format string in the following example and have it print "hello world"?

printf(<missing>, "world", "hello");

* by itself is a special case of *n$. All the various forms of argument re-ordering and parameter-specified field values are supported by both stdlib and CF/NSString.

printf("%2$s %1$s", "world", "hello");

-- Gwynne, key to the Code that runs us all
Formerly known as Sailor Quasar.
Email: email@hidden
Web: http://musicimage.plasticchicken.com/
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.


References: 
 >Is Concatenation that complex? (From: Adam <email@hidden>)
 >Re: Is Concatenation that complex? (From: Marco Scheurer <email@hidden>)
 >Re: Is Concatenation that complex? (From: Finlay Dobbie <email@hidden>)
 >Re: Is Concatenation that complex? (From: Bob Ippolito <email@hidden>)
 >Re: Is Concatenation that complex? (From: Gwynne <email@hidden>)
 >NSString format specifiers (was: Is Concatenation that complex?) (From: Allan Odgaard <email@hidden>)
 >Re: NSString format specifiers (was: Is Concatenation that complex?) (From: Gwynne <email@hidden>)
 >Re: NSString format specifiers (was: Is Concatenation that complex?) (From: Allan Odgaard <email@hidden>)

  • Prev by Date: Re: NSString format specifiers (was: Is Concatenation that complex?)
  • Next by Date: ZeroLink and duplicate symbols
  • Previous by thread: Re: NSString format specifiers (was: Is Concatenation that complex?)
  • Next by thread: Re: NSString format specifiers (was: Is Concatenation that complex?)
  • Index(es):
    • Date
    • Thread