4件ヒット
[1-4件を表示]
(0.073秒)
ライブラリ
- ビルトイン (4)
キーワード
- << (1)
-
append
_ as _ bytes (1)
検索結果
先頭4件
-
String
# concat(*arguments) -> self (135454.0) -
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!!!"
//}
@see String#append_as_bytes... -
String
# concat(other) -> self (135424.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
# append _ as _ bytes(*objects) -> self (90169.0) -
引数で与えたオブジェクトをバイト列として、self に破壊的に連結します。
...は連結できない
s << "い" # => "incompatible character encodings: BINARY (ASCII-8BIT) and UTF-8 (Encoding::CompatibilityError)
//}
//emlist[引数で整数を渡す例][ruby]{
t = ""
t.append_as_bytes(0x61) # => "a"
t.append_as_bytes(0x3062) # => "ab"
//}
@see String#<<, String#concat... -
String
# <<(other) -> self (90124.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"
//}...