るりまサーチ

最速Rubyリファレンスマニュアル検索!
396件ヒット [1-100件を表示] (0.224秒)

別のキーワード

  1. etc sc_xopen_enh_i18n
  2. rsa n
  3. rsa n=
  4. openssl n=
  5. pop n_mails

ライブラリ

クラス

モジュール

キーワード

検索結果

<< 1 2 3 ... > >>

String#replace(other) -> String (27308.0)

self の内容を other の内容で置き換えます。

...self の内容を other の内容で置き換えます。

//emlist[例][ruby]{
str = "foo"
str.replace "bar"
p str # => "bar"
//}...

Array#replace(another) -> self (24326.0)

配列の内容を配列 another の内容で置き換えます。

...配列の内容を配列 another の内容で置き換えます。

@param another 配列を指定します。
配列以外のオブジェクトを指定した場合は to_ary メソッドに
よる暗黙の型変換を試みます。

@raise TypeError 引数に配列...
...以外の(暗黙の型変換が行えない)オブジェクトを
指定した場合に発生します。

//emlist[例][ruby]{
a
= [1, 2, 3]
a
.replace [4, 5, 6]
p a #=> [4, 5, 6]
//}...

Set#replace(enum) -> self (24308.0)

集合の要素をすべて削除し、enum で与えられた要素に置き換えます。

...除し、enum で与えられた要素に置き換えます。

引数 enum には each メソッドが定義されている必要があります。

@param enum 置き換え後の集合要素を格納するオブジェクトを指定します。
@raise ArgumentError 引数 enum に each メソッ...
...ドが定義されていない場合に
発生します。

//emlist[][ruby]{
require 'set'
p s = Set[10, 20, 30] # => #<Set: {10, 20, 30}>
s.replace([15, 25])
p s # => #<Set: {15, 25}>
//}...

Encoding::Converter#replacement=(string) (18319.0)

置換文字を設定します。

...置換文字を設定します。

@param string 変換器に設定する置換文字

//emlist[][ruby]{
ec = Encoding::Converter.new("utf-8", "us-ascii", :undef => :replace)
ec.replacement = "<undef>"
p ec.convert("a \u3042 b") #=> "a <undef> b"
//}...

Encoding::Converter#replacement -> String (18301.0)

変換器に設定されている置換文字を返します。

...器に設定されている置換文字を返します。

@return 変換器に設定されている置換文字

//emlist[][ruby]{
ec = Encoding::Converter.new("euc-jp", "us-ascii")
p ec.replacement #=> "?"

ec = Encoding::Converter.new("euc-jp", "utf-8")
p ec.replacement #=> "\uFFFD"
//}...

絞り込み条件を変える

REXML::Parent#replace_child(to_replace, replacement) -> () (15731.0)

子ノード列上の to_replace を replacement に置き換えます。

...子ノード列上の to_replace replacement に置き換えます。

to_replace の parent は nil に、
replace
ment の parent は selfに変更されます。

@param to_replace 置き換え元のノード
@param replacement 置き換え先のノード...

String#pathmap_replace(patterns) { ... } -> String (15402.0)

与えられたパスを前もって置き換えます。

...与えられたパスを前もって置き換えます。

@param patterns 'pat1,rep1;pat2,rep2;...' のような形式で置換パターンを指定します。...

StringScanner#string -> String (12207.0)

スキャン対象にしている文字列を返します。

...quire 'strscan'

s = StringScanner.new('test string')
s.string # => "test string"
//}

返り値は freeze されていません。

//emlist[例][ruby]{
require 'strscan'

s = StringScanner.new('test string')
s.string.frozen? # => false
//}

なお、このメソッドは StringScanner.new に渡...
...コードを書かないようにしましょう。

//emlist[例][ruby]{
require 'strscan'

str = 'test string'
s = StringScanner.new(str)
s.string == str # => true
s.string.eql?(str) # => true (将来は false になる可能性がある)
//}

また、返り値の文字列に対して破壊的...
...ないでください。

//emlist[例][ruby]{
require 'strscan'

str = 'test string'
s = StringScanner.new(str)
s.string.replace("0123")
s.scan(/\w+/) # => "0123" (将来は "test" が返る可能性あり)
str # => "0123" (将来は "test string" が返る可能性あり)
//}...

UnboundMethod#arity -> Integer (9237.0)

メソッドが受け付ける引数の数を返します。

...by]{
class C
def one; end
def two(a); end
def three(*a); end
def four(a, b); end
def five(a, b, *c); end
def six(a, b, *c, &d); end
end

p C.instance_method(:one).arity #=> 0
p C.instance_method(:two).arity #=> 1
p C.instance_method(:three).arity #=> -1
p C.instance_meth...
...od(:four).arity #=> 2
p C.instance_method(:five).arity #=> -3
p C.instance_method(:six).arity #=> -3


String.instance_method(:size).arity #=> 0
String.instance_method(:replace).arity #=> 1
String.instance_method(:squeeze).arity #=> -1
String.instance_method(:count).arity #=>...

Pathname#sub(pattern) {|matched| ... } -> Pathname (6408.0)

self を表現するパス文字列に対して sub メソッドを呼び出し、その結果を内 容とする新しい Pathname オブジェクトを生成し、返します。

...Pathname オブジェクトを生成し、返します。

@param pattern 置き換える文字列のパターンを指定します。

@param replace pattern で指定した文字列と置き換える文字列を指定します。

//emlist[例][ruby]{
require 'pathname'

path1 = Pathname('/usr/bin...
.../perl')
path1.sub('perl', 'ruby') #=> #<Pathname:/usr/bin/ruby>
//}

@see String#sub...

絞り込み条件を変える

<< 1 2 3 ... > >>