るりまサーチ (Ruby 2.3.0)

最速Rubyリファレンスマニュアル検索!
2件ヒット [1-2件を表示] (0.016秒)
トップページ > バージョン:2.3.0[x] > クラス:String[x] > クエリ:concat[x]

別のキーワード

  1. _builtin concat
  2. _builtin collect_concat
  3. enumerable collect_concat
  4. array concat
  5. string concat

ライブラリ

検索結果

String#concat(other) -> self (45325.0)

self に文字列 other を破壊的に連結します。 other が 整数である場合は other.chr(self.encoding) 相当の文字を末尾に追加します。

...追加します。

self を返します。

@param other 文字列もしくは 0 以上の整数

//emlist[例][ruby]{
str = "string"
str.concat "XXX"
p str # => "stringXXX"

str << "YYY"
p str # => "stringXXXYYY"

str << 65 # 文字AのASCIIコード
p str # => "stringXXXYYYA"
//}...

String#<<(other) -> self (25.0)

self に文字列 other を破壊的に連結します。 other が 整数である場合は other.chr(self.encoding) 相当の文字を末尾に追加します。

...追加します。

self を返します。

@param other 文字列もしくは 0 以上の整数

//emlist[例][ruby]{
str = "string"
str.concat "XXX"
p str # => "stringXXX"

str << "YYY"
p str # => "stringXXXYYY"

str << 65 # 文字AのASCIIコード
p str # => "stringXXXYYYA"
//}...