別のキーワード
ライブラリ
モジュール
キーワード
- BMPString (24)
- BitString (24)
- Float (12)
- GeneralString (24)
- GraphicString (24)
- IA5String (24)
- ISO64String (24)
- Integer (12)
- NumericString (24)
- OctetString (24)
- PrintableString (24)
- T61String (24)
- UTF8String (24)
- UniversalString (24)
- VideotexString (24)
- ` (12)
- abbrev (12)
-
allocation
_ sourcefile (12) - argv0 (12)
- autoload (12)
- autoload? (12)
- caller (36)
- chomp (12)
- chop (12)
- confstr (12)
-
count
_ objects _ size (12) - dump (12)
- encode64 (12)
-
fast
_ generate (12) -
fast
_ unparse (12) - format (12)
- generate (12)
- getlogin (12)
- gets (12)
- gsub (36)
- h (12)
- hexencode (12)
-
html
_ escape (12) - isjis (12)
- load (12)
- open (2)
- pipeline (12)
-
pretty
_ generate (12) -
pretty
_ unparse (12) - readline (24)
- readlines (12)
- restore (12)
- setproctitle (12)
- sprintf (12)
- sub (24)
- sysconfdir (12)
- systmpdir (12)
-
trace
_ var (36) - trap (24)
- u (12)
- uname (12)
- unparse (12)
-
untrace
_ var (12) -
url
_ encode (12) -
urlsafe
_ encode64 (12)
検索結果
先頭5件
-
Kernel
. # format(format , *arg) -> String (3745.0) -
format 文字列を C 言語の sprintf と同じように解釈し、 引数をフォーマットした文字列を返します。
...@param format フォーマット文字列です。
@param arg フォーマットされる引数です。
@see Kernel.#printf,Time#strftime,Date.strptime
=== sprintf フォーマット
Ruby の sprintf フォーマットは基本的に C 言語の sprintf(3)
のものと同じです。ただし......, %B)が存在すること、sprintf のすべての方言をサ
ポートしていないこと(%': 3桁区切り)などの違いがあります。
Ruby には整数の大きさに上限がないので、%b, %B, %o, %x, %X
に負の数を与えると (左側に無限に1が続くとみなせるの......の書式です。[] で囲まれた部分は省略可
能であることを示しています。
%[nth$][フラグ][幅][.精度]指示子
%[<name>][フラグ][幅][.精度]指示子
`%' 自身を出力するには `%%' とします。
以下それぞれの要素に関して説明します。... -
Kernel
. # sprintf(format , *arg) -> String (3745.0) -
format 文字列を C 言語の sprintf と同じように解釈し、 引数をフォーマットした文字列を返します。
...@param format フォーマット文字列です。
@param arg フォーマットされる引数です。
@see Kernel.#printf,Time#strftime,Date.strptime
=== sprintf フォーマット
Ruby の sprintf フォーマットは基本的に C 言語の sprintf(3)
のものと同じです。ただし......, %B)が存在すること、sprintf のすべての方言をサ
ポートしていないこと(%': 3桁区切り)などの違いがあります。
Ruby には整数の大きさに上限がないので、%b, %B, %o, %x, %X
に負の数を与えると (左側に無限に1が続くとみなせるの......の書式です。[] で囲まれた部分は省略可
能であることを示しています。
%[nth$][フラグ][幅][.精度]指示子
%[<name>][フラグ][幅][.精度]指示子
`%' 自身を出力するには `%%' とします。
以下それぞれの要素に関して説明します。... -
Kernel
. # gsub(pattern) -> Enumerator (3221.0) -
$_.gsub とほぼ同じですが、置換が発生したときは、$_の内容を置き換える点が異なります。 コマンドラインオプションで -p または -n を指定した時のみ定義されます。
...@param pattern 置き換える文字列のパターンを表す文字列か正規表現。
文字列を指定した場合は全く同じ文字列にだけマッチする
@param replace pattern で指定した文字列と置き換える文字列
//emlist[例][ruby]{
$_......# => "test\n"
gsub(/es/, '!!') # => "t!!t\n"
//}
@see String#gsub,$_... -
Kernel
. # gsub(pattern) {|matched| . . . } -> String (3221.0) -
$_.gsub とほぼ同じですが、置換が発生したときは、$_の内容を置き換える点が異なります。 コマンドラインオプションで -p または -n を指定した時のみ定義されます。
...@param pattern 置き換える文字列のパターンを表す文字列か正規表現。
文字列を指定した場合は全く同じ文字列にだけマッチする
@param replace pattern で指定した文字列と置き換える文字列
//emlist[例][ruby]{
$_......# => "test\n"
gsub(/es/, '!!') # => "t!!t\n"
//}
@see String#gsub,$_... -
Kernel
. # gsub(pattern , replace) -> String (3221.0) -
$_.gsub とほぼ同じですが、置換が発生したときは、$_の内容を置き換える点が異なります。 コマンドラインオプションで -p または -n を指定した時のみ定義されます。
...@param pattern 置き換える文字列のパターンを表す文字列か正規表現。
文字列を指定した場合は全く同じ文字列にだけマッチする
@param replace pattern で指定した文字列と置き換える文字列
//emlist[例][ruby]{
$_......# => "test\n"
gsub(/es/, '!!') # => "t!!t\n"
//}
@see String#gsub,$_... -
Kernel
. # sub(pattern) {|matched| . . . } -> String (3221.0) -
$_.sub とほぼ同じですが、置換が発生したときは、$_の内容を置き換える点が異なります。 コマンドラインオプションで -p または -n を指定した時のみ定義されます。
...い。
@raise ArgumentError replace を指定しなかった場合に発生します。
$_.sub とこのメソッド sub は以下の点で違いがあります。
* sub は $_ の値をコピーして、コピーの方を更新し、
$_ に再代入します。
@param pattern 置き換......現。
文字列を指定した場合は全く同じ文字列にだけマッチする
@param replace pattern で指定した文字列と置き換える文字列
//emlist[例][ruby]{
$_ # => "testtest\n"
sub(/es/, '!!') # => "t!!ttest\n"
//}
@see String#sub,$_... -
Kernel
. # sub(pattern , replace) -> String (3221.0) -
$_.sub とほぼ同じですが、置換が発生したときは、$_の内容を置き換える点が異なります。 コマンドラインオプションで -p または -n を指定した時のみ定義されます。
...い。
@raise ArgumentError replace を指定しなかった場合に発生します。
$_.sub とこのメソッド sub は以下の点で違いがあります。
* sub は $_ の値をコピーして、コピーの方を更新し、
$_ に再代入します。
@param pattern 置き換......現。
文字列を指定した場合は全く同じ文字列にだけマッチする
@param replace pattern で指定した文字列と置き換える文字列
//emlist[例][ruby]{
$_ # => "testtest\n"
sub(/es/, '!!') # => "t!!ttest\n"
//}
@see String#sub,$_... -
Kernel
. # autoload?(const _ name) -> String | nil (3220.0) -
const_name が Kernel.#autoload 設定されているか調べます。
...const_name が Kernel.#autoload 設定されているか調べます。
autoload 設定されていて、autoload 定数がまだ定義されてない(ロードされていない)
ときにそのパス名を返します。
autoload 設定されていないか、ロード済みなら nil を返し......ます。
@param const_name 定数をString または Symbol で指定します。
//emlist[例][ruby]{
# ------- /tmp/foo.rb ---------
class Foo
class Bar
end
end
# ----- end of /tmp/foo.rb ----
class Foo
end
p Foo.autoload?(:Bar) #=> nil
Foo.autoload :Bar, '/tmp/foo'
p Foo.autoload?......(:Bar) #=> "/tmp/foo"
p Foo::Bar #=> Foo::Bar
p Foo.autoload?(:Bar) #=> nil
//}
@see Kernel.#autoload... -
Etc
. # confstr(name) -> String | nil (3214.0) -
confstr(3) で取得したシステム設定変数の値を返します。
...m name Etc モジュールの CS_ で始まる定数のいずれかを指定します。
引数 name に対応する設定が行われていない状態の場合は nil を返します。
(confstr(3) が -1 を返し、errno が設定されていない場合)
//emlist[][ruby]{
require "etc"
Etc.co......nfstr(Etc::CS_PATH) # => "/bin:/usr/bin"
# GNU/Linux
Etc.confstr(Etc::CS_GNU_LIBC_VERSION) # => "glibc 2.18"
Etc.confstr(Etc::CS_GNU_LIBPTHREAD_VERSION) # => "NPTL 2.18"
//}...