6件ヒット
[1-6件を表示]
(0.031秒)
検索結果
先頭5件
-
Kernel
. # format(format , *arg) -> String (18610.0) -
format 文字列を C 言語の sprintf と同じように解釈し、 引数をフォーマットした文字列を返します。
...トした文字列を返します。
@param format フォーマット文字列です。
@param arg フォーマットされる引数です。
@see Kernel.#printf,Time#strftime,Date.strptime
=== sprintf フォーマット
Ruby の sprintf フォーマットは基本的に C 言語の sprintf(3)......tf("%p", /e+/) #=> "/e+/"
//}
: d
: i
引数の数値を10進表現の整数として出力します。
引数が整数でなければ関数 Kernel.#Integer と同じ規則で整数に
変換されます。
//emlist[][ruby]{
p sprintf("%d", -1) #=> "-1"
p sprintf("%d", 3.1) #=> "3"
p sprint... -
Kernel
. # sprintf(format , *arg) -> String (9310.0) -
format 文字列を C 言語の sprintf と同じように解釈し、 引数をフォーマットした文字列を返します。
...トした文字列を返します。
@param format フォーマット文字列です。
@param arg フォーマットされる引数です。
@see Kernel.#printf,Time#strftime,Date.strptime
=== sprintf フォーマット
Ruby の sprintf フォーマットは基本的に C 言語の sprintf(3)......tf("%p", /e+/) #=> "/e+/"
//}
: d
: i
引数の数値を10進表現の整数として出力します。
引数が整数でなければ関数 Kernel.#Integer と同じ規則で整数に
変換されます。
//emlist[][ruby]{
p sprintf("%d", -1) #=> "-1"
p sprintf("%d", 3.1) #=> "3"
p sprint... -
Kernel
. # open(file , mode _ enc = "r" , perm = 0666) -> IO (310.0) -
file をオープンして、IO(Fileを含む)クラスのインスタンスを返します。
file をオープンして、IO(Fileを含む)クラスのインスタンスを返します。
ブロックが与えられた場合、指定されたファイルをオープンし、
生成した IO オブジェクトを引数としてブロックを実行します。
ブロックの終了時や例外によりブロックを脱出するとき、
ファイルをクローズします。ブロックを評価した結果を返します。
ファイル名 file が `|' で始まる時には続く文字列をコマンドとして起動し、
コマンドの標準入出力に対してパイプラインを生成します
ファイル名が "|-" である時、open は Ruby の子プロセス
を生成し、その子プロセスとの間のパイプ(IOオブジェクト)を... -
Kernel
. # open(file , mode _ enc = "r" , perm = 0666) {|io| . . . } -> object (310.0) -
file をオープンして、IO(Fileを含む)クラスのインスタンスを返します。
file をオープンして、IO(Fileを含む)クラスのインスタンスを返します。
ブロックが与えられた場合、指定されたファイルをオープンし、
生成した IO オブジェクトを引数としてブロックを実行します。
ブロックの終了時や例外によりブロックを脱出するとき、
ファイルをクローズします。ブロックを評価した結果を返します。
ファイル名 file が `|' で始まる時には続く文字列をコマンドとして起動し、
コマンドの標準入出力に対してパイプラインを生成します
ファイル名が "|-" である時、open は Ruby の子プロセス
を生成し、その子プロセスとの間のパイプ(IOオブジェクト)を... -
Kernel
. # printf(format , *arg) -> nil (310.0) -
C 言語の printf と同じように、format に従い引数を文字列に変 換して port に出力します。
...out に出力します。
引数を 1 つも指定しなければ何もしません。
Ruby における format 文字列の拡張については
Kernel.#sprintfの項を参照してください。
@param port 出力先になるIO のサブクラスのインスタンスです。
@param format フ......011 ' 123'"
printf("%1$*2$s %2$d %1$s", "hello", 8) #=> " hello 8 hello"
printf("%1$*2$s %2$d", "hello", -8) #=> "hello -8"
printf("%+g:% g:%-g", 1.23, 1.23, 1.23) #=> "+1.23: 1.23:1.23"
printf("%u", -123) #=> "..4294967173"
//}
@see Kernel.#sprintf,IO#printf... -
Kernel
. # printf(port , format , *arg) -> nil (310.0) -
C 言語の printf と同じように、format に従い引数を文字列に変 換して port に出力します。
...out に出力します。
引数を 1 つも指定しなければ何もしません。
Ruby における format 文字列の拡張については
Kernel.#sprintfの項を参照してください。
@param port 出力先になるIO のサブクラスのインスタンスです。
@param format フ......011 ' 123'"
printf("%1$*2$s %2$d %1$s", "hello", 8) #=> " hello 8 hello"
printf("%1$*2$s %2$d", "hello", -8) #=> "hello -8"
printf("%+g:% g:%-g", 1.23, 1.23, 1.23) #=> "+1.23: 1.23:1.23"
printf("%u", -123) #=> "..4294967173"
//}
@see Kernel.#sprintf,IO#printf...