NSString format specifiers (was: Is Concatenation that complex?)
NSString format specifiers (was: Is Concatenation that complex?)
- Subject: NSString format specifiers (was: Is Concatenation that complex?)
- From: Allan Odgaard <email@hidden>
- Date: Wed, 28 Apr 2004 02:59:52 +0200
On 27. Apr 2004, at 22:39, Gwynne wrote:
[...] The only difference between printf() specifiers and
NSString/CFString specifiers is that the latter add %C
(Unicode/wchar_t version of %c), %S (Unicode/wchar_t version of %s),
No, these things are also supported for the stdlib, where S is short
for ls (wchar_t*) and C is short for lc (wchar_t). The documentation
says:
For each wide character in the string, the
(potentially multi-byte) sequence representing
the wide character is written, including any
shift sequences [...]
But I don't think it actually works for non 8 bit characters.
and %@ (any Cocoa or CoreFoundation object, as the result of [object
description] or CFCopyDescription(object).) Someone correct me if I
forgot or misrepresented any :).
CFString/NSString also supports reordering of arguments, e.g.:
NSLog(@"%2$@ %1$@", @"world", @"hello");
Which will print "hello world". This is very useful for localizing.
But it fails to support the 'z' modifier (used for size_t). Maybe if
they would document their supported format specifiers/placeholders, I
would know wether or not this is a bug ;)
--
et al: used as an abbreviation when referring to a number of people, for
example: "It has been improved by Knuth et al." [syn: and others, et
alii]
etc: continuing in the same way [syn: and so forth, and so on, et
cetera].
_______________________________________________
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.