るりまサーチ

最速Rubyリファレンスマニュアル検索!
2130件ヒット [901-1000件を表示] (0.069秒)

別のキーワード

  1. rbconfig ruby
  2. fiddle ruby_free
  3. fiddle build_ruby_platform
  4. rake ruby
  5. rubygems/defaults ruby_engine

ライブラリ

キーワード

検索結果

<< < ... 8 9 10 11 12 ... > >>

String#+(other) -> String (9121.0)

文字列と other を連結した新しい文字列を返します。

...er を連結した新しい文字列を返します。

@param other 文字列
@return self と other を連結した文字列

//emlist[例][ruby]{
p "str" + "ing" # => "string"

a = "abc"
b = "def"
p a + b # => "abcdef"
p a # => "abc" (変化なし)
p b # => "def"
//}...

String#delete(*strs) -> String (9121.0)

self から strs に含まれる文字を取り除いた文字列を生成して返します。

...合は、
すべての引数にマッチする文字だけが削除されます。

@param strs 削除する文字列を示す文字列 (のリスト)

//emlist[例][ruby]{
p "123456789".delete("2378") #=> "14569"
p "123456789".delete("2-8", "^4-6") #=> "14569"
//}

@see String#delete!...

String#dump -> String (9121.0)

文字列中の非表示文字をバックスラッシュ記法に置き換えた文字列を返します。 str == eval(str.dump) となることが保証されています。

...文字列を返します。
str == eval(str.dump) となることが保証されています。

//emlist[例][ruby]{
# p だとさらにバックスラッシュが増えて見にくいので puts している
puts "abc\r\n\f\x00\b10\\\"".dump # => "abc\r\n\f\x00\b10\\\""
//}

@see String#undump...

String#prepend(*arguments) -> String (9118.0)

複数の文字列を先頭に破壊的に追加します。

...複数の文字列を先頭に破壊的に追加します。

@param arguments 追加したい文字列を指定します。

//emlist[例][ruby]{
a = "!!!"
a.prepend # => "!!!"
a # => "!!!"

a = "!!!"
a.prepend "hello ", "world" # => "hello world!!!"
a # => "hello...

String#prepend(other_str) -> String (9118.0)

文字列 other_str を先頭に破壊的に追加します。

...文字列 other_str を先頭に破壊的に追加します。

@param other_str 追加したい文字列を指定します。

//emlist[例][ruby]{
a = "world"
a.prepend("hello ") # => "hello world"
a # => "hello world"
//}...

絞り込み条件を変える

String#sub!(pattern, hash) -> String (9117.0)

文字列中の pattern にマッチした部分をキーにして hash を引いた値で破壊的に置き換えます。

文字列中の pattern にマッチした部分をキーにして hash を引いた値で破壊的に置き換えます。

@param pattern 置き換える文字列のパターン
@param hash 置き換える文字列を与えるハッシュ
@return 置換した場合は self、置換しなかった場合は nil

String#*(times) -> String (9115.0)

文字列の内容を times 回だけ繰り返した新しい文字列を作成して返します。

...self を times 回繰り返した新しい文字列

@raise ArgumentError 引数に負数を指定したときに発生します。

//emlist[例][ruby]{
p "str" * 3 # => "strstrstr"

str = "abc"
p str * 4 # => "abcabcabcabc"
p str * 0 # => ""
p str # => "abc" (変化なし)
//}...

String#b -> String (9115.0)

self の文字エンコーディングを ASCII-8BIT にした文字列の複製を返します。

...self の文字エンコーディングを ASCII-8BIT にした文字列の複製を返します。

//emlist[例][ruby]{
'abc123'.encoding # => #<Encoding:UTF-8>
'abc123'.b.encoding # => #<Encoding:ASCII-8BIT>
//}...

String#dump -> String (9115.0)

文字列中の非表示文字をバックスラッシュ記法に置き換えた文字列を返します。 str == eval(str.dump) となることが保証されています。

...ラッシュ記法に置き換えた文字列を返します。
str == eval(str.dump) となることが保証されています。

//emlist[例][ruby]{
# p だとさらにバックスラッシュが増えて見にくいので puts している
puts "abc\r\n\f\x00\b10\\\"".dump # => "abc\r\n\f\x0...

String#prepend(other_str) -> String (9115.0)

文字列 other_str を先頭に破壊的に追加します。

...文字列 other_str を先頭に破壊的に追加します。

@param other_str 追加したい文字列を指定します。

//emlist[例][ruby]{
a = "world"
a.prepend("hello ") # => "hello world"
a # => "hello world"
//}...

絞り込み条件を変える

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

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

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

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

String#reverse -> String (9115.0)

文字列を文字単位で左右逆転した文字列を返します。

...文字列を文字単位で左右逆転した文字列を返します。

//emlist[例][ruby]{
p "foobar".reverse # => "raboof"
p "".reverse # => ""
//}...
<< < ... 8 9 10 11 12 ... > >>