This article summarizes the format specifiers supported by string formatting methods and functions.
Format Specifiers
The format specifiers supported by the NSString
formatting methods and CFString formatting functions follow the IEEE printf specification; the specifiers are summarized in Table 1. Note that you can also use the n$
positional specifiers such as %1$@ %2$s
. For more details, see the IEEE printf specification. You can also use these format specifiers with the NSLog
function.
- NSString格式化方法和CFString格式化函数支持的格式说明符遵循IEEE printf规范; 表1总结了说明符。请注意,您还可以使用
n$
位置说明符,例如%1$@ %2$s
。 有关更多详细信息,请参阅IEEE printf规范。 您也可以将这些格式说明符与NSLog函数一起使用。
Table 1 Format specifiers supported by the NSString formatting methods and CFString formatting functions
- NSString格式化方法和CFString格式化函数支持的格式说明符


Table 2 Length modifiers supported by the NSString formatting methods and CFString formatting functions
- NSString格式化方法和CFString格式化函数支持的长度修饰符
未完待续。。。
网友评论