美文网首页
05. String Format Specifiers

05. String Format Specifiers

作者: ngugg | 来源:发表于2018-10-29 14:50 被阅读0次

相关链接:https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/Strings/Articles/formatSpecifiers.html#//apple_ref/doc/uid/TP40004265-SW1

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格式化函数支持的格式说明符
image.png image.png

Table 2 Length modifiers supported by the NSString formatting methods and CFString formatting functions

  • NSString格式化方法和CFString格式化函数支持的长度修饰符

未完待续。。。

相关文章

网友评论

      本文标题:05. String Format Specifiers

      本文链接:https://www.haomeiwen.com/subject/hkpbtqtx.html