programming:mac:nsstring_format_specifiers

差分

このページの2つのバージョン間の差分を表示します。

この比較画面にリンクする

次のリビジョン
前のリビジョン
programming:mac:nsstring_format_specifiers [2013-11-01 00:16]
Decomo 作成
programming:mac:nsstring_format_specifiers [2015-01-06 11:51] (現在)
行 1: 行 1:
 ====== NSStringで使える書式指定子 ====== ====== NSStringで使える書式指定子 ======
  
-Mac OS X v10.6の「String Format Specifiers」より抜粋。+Mac OS X v10.6の「String Format Specifiers」より抜粋。最新の情報が欲しい人はググってくだしあ
  
 ^  指定子  ^  解説  | ^  指定子  ^  解説  |
-|%@|Objective-Cオブジェクト。利用可能なら<ilcode>descriptionWithLocale:</ilcode>ないし<ilcode>description</ilcode>が返す文字列を表示する。同様に<ilcode>CFTypeRef</ilcode>オブジェクトも対象で、<ilcode>CFCopyDescription</ilcode>の結果を返す。|+|%@|Objective-Cオブジェクト。利用可能なら''descriptionWithLocale:''ないし''description''が返す文字列を表示する。同様に''CFTypeRef''オブジェクトも対象で、''CFCopyDescription''の結果を返す。|
 |%%|'%'文字| |%%|'%'文字|
-|%d, %D, %i|符号あり32ビット整数(int)|+|%d, %D, %i|符号付き32ビット整数(int)|
 |%u, %U|符号なし32ビット整数(unsigned int)| |%u, %U|符号なし32ビット整数(unsigned int)|
-|%hi|符号あり16ビット整数(short)|+|%hi|符号付き16ビット整数(short)|
 |%hu|符号なし16ビット整数(unsigned short)| |%hu|符号なし16ビット整数(unsigned short)|
-|%qi|符号あり64ビット整数(long long)|+|%qi|符号付き64ビット整数(long long)|
 |%qu|符号なし64ビット整数(unsigned long long)| |%qu|符号なし64ビット整数(unsigned long long)|
 |%x|符号なし32ビット整数(unsigned int)を16進表記。小文字のa〜fを用いる。| |%x|符号なし32ビット整数(unsigned int)を16進表記。小文字のa〜fを用いる。|
行 20: 行 20:
 |%e|64ビット浮動小数点値(double)を指数表記。指数文字は小文字のeを用いる。| |%e|64ビット浮動小数点値(double)を指数表記。指数文字は小文字のeを用いる。|
 |%E|64ビット浮動小数点値(double)を指数表記。指数文字は大文字のEを用いる。| |%E|64ビット浮動小数点値(double)を指数表記。指数文字は大文字のEを用いる。|
-|%g|64-bit floating-point number (double), printed in the style of %e if the exponent is less than –4 or greater than or equal to the precision, in the style of %f otherwise+|%g|64ビット浮動小数点値(double)を指数が-4〜5なら%e形式で、それ以外は%f形式で表示する。
-|%G|64-bit floating-point number (double), printed in the style of %E if the exponent is less than –4 or greater than or equal to the precision, in the style of %f otherwise+|%G|64ビット浮動小数点値(double)を指数が-4〜5なら%E形式で、それ以外は%f形式で表示する。
-|%c|8ビット符号なし文字(unsigned char)。<ilcode>NSLog()</ilcode>ではASCIIキャラクターを表示し、非ASCIIキャラクターの場合は\\dddの8進表記で、Unicodeは\\uddddの16進表記で表示する(ここでdは桁を表す)。| +|%c|8ビット符号なし文字(unsigned char)。''NSLog()''ではASCIIキャラクターを表示し、非ASCIIキャラクターの場合は\\dddの8進表記で、Unicodeは\\uddddの16進表記で表示する(ここでdは桁を表す)。| 
-|%C|16ビットUnicode文字(unichar)。<ilcode>NSLog()</ilcode>ではASCIIキャラクターを表示し、非ASCIIキャラクターの場合は\\dddの8進表記で、Unicodeは\\uddddの16進表記で表示する(ここでdは桁を表す)。|+|%C|16ビットUnicode文字(unichar)。''NSLog()''ではASCIIキャラクターを表示し、非ASCIIキャラクターの場合は\\dddの8進表記で、Unicodeは\\uddddの16進表記で表示する(ここでdは桁を表す)。|
 |%s|NULL終端の8ビット符号なし文字配列。%s interprets its input in the system encoding rather than, for example, UTF-8.| |%s|NULL終端の8ビット符号なし文字配列。%s interprets its input in the system encoding rather than, for example, UTF-8.|
 |%S|NULL終端の16ビットUnicode文字配列。| |%S|NULL終端の16ビットUnicode文字配列。|
 |%p|voidポインタ(void *)。0xに続く16進表記。小文字のa〜fを用いる。| |%p|voidポインタ(void *)。0xに続く16進表記。小文字のa〜fを用いる。|
-|%L|長さ修飾子。a, A, e, E, f, F, g, Gを修飾すると、long doubleの引数を受ける指定子へ変化る。| +|%L|長さ修飾子。a, A, e, E, f, F, g, Gを前置修飾、long doubleの引数を受ける指定子へ変化させる。| 
-|%a|64-bit floating-point number (double), printed in scientific notation with a leading 0x and one hexadecimal digit before the decimal point using a lowercase to introduce the exponent+|%a|64ビット浮動小数点値(double)を16進の科学的記数法で表示する。小数点の前に0xで始まる1桁の16進数を持ち、指数は小文字のpの後ろに記す。
-|%A|64-bit floating-point number (double), printed in scientific notation with a leading 0X and one hexadecimal digit before the decimal point using a uppercase to introduce the exponent+|%A|64ビット浮動小数点値(double)を16進の科学的記数法で表示する。小数点の前に0Xで始まる1桁の16進数を持ち、指数は大文字のPの後ろに記す。
-|%F|64-bit floating-point number (double), printed in decimal notation+|%F|64ビット浮動小数点値(double)を10進表記法で表示する。
-|%z|Length modifier specifying that a following d, i, o, u, x, or conversion specifier applies to a size_t or the corresponding signed integer type argument+|%z|長さ修飾子。d, i, o, u, x, Xを前置修飾し、size_tないし相当する符号付き整数型の引数を取る指定子へと変化させる。
-|%t|Length modifier specifying that a following d, i, o, u, x, or conversion specifier applies to a ptrdiff_t or the corresponding unsigned integer type argument+|%t|長さ修飾子。d, i, o, u, x, Xを前置修飾し、ptrdiff_tないし相当する符号付き整数型の引数を取る指定子へと変化させる。
-|%j|Length modifier specifying that a following d, i, o, u, x, or conversion specifier applies to a intmax_t or uintmax_t argument|+|%j|長さ修飾子。d, i, o, u, x, Xを前置修飾し、intmax_tまたはuintmax_tの引数を取る指定子へと変化させる。| 
  • programming/mac/nsstring_format_specifiers.1383232610.txt.gz
  • 最終更新: 2013-11-01 00:16
  • by Decomo