10件ヒット
[1-10件を表示]
(0.134秒)
別のキーワード
ライブラリ
- ビルトイン (10)
検索結果
-
String
# concat(*arguments) -> self (21343.0) -
self に複数の文字列を破壊的に連結します。
...は Integer#chr の結果に相当する文字を末尾に追加します。追加する文字のエンコーディングは self.encoding です。
self を返します。
@param arguments 複数の文字列もしくは 0 以上の整数
//emlist[例][ruby]{
str = "foo"
str.concat
p str # =>......"foo"
str = "foo"
str.concat "bar", "baz"
p str # => "foobarbaz"
str = "foo"
str.concat("!", 33, 33)
p str # => "foo!!!"
//}......"foo"
str = "foo"
str.concat "bar", "baz"
p str # => "foobarbaz"
str = "foo"
str.concat("!", 33, 33)
p str # => "foo!!!"
//}
@see String#append_as_bytes... -
String
# append _ as _ bytes(*objects) -> self (6244.0) -
引数で与えたオブジェクトをバイト列として、self に破壊的に連結します。
...st[例][ruby]{
s = "あ".b # => "\xE3\x81\x82"
s.encoding # => #<Encoding:BINARY (ASCII-8BIT)>
s.append_as_bytes("い") # => "\xE3\x81\x82\xE3\x81\x84"
# s << "い" では連結できない
s << "い" # => "incompatible character encodings: BINARY (ASCII-8BIT) and UT......F-8 (Encoding::CompatibilityError)
//}
//emlist[引数で整数を渡す例][ruby]{
t = ""
t.append_as_bytes(0x61) # => "a"
t.append_as_bytes(0x3062) # => "ab"
//}
@see String#<<, String#concat...