別のキーワード
ライブラリ
- ビルトイン (247)
キーワード
- << (12)
-
append
_ as _ bytes (1) - casecmp (12)
- concat (21)
- encode (36)
- encode! (24)
-
force
_ encoding (12) - scrub (36)
- scrub! (36)
-
unicode
_ normalize (11) -
unicode
_ normalize! (11) -
unicode
_ normalized? (11) - unpack (12)
検索結果
先頭5件
-
String
# casecmp(other) -> -1 | 0 | 1 | nil (9054.0) -
String#<=> と同様に文字列の順序を比較しますが、 アルファベットの大文字小文字の違いを無視します。
...
String#<=> と同様に文字列の順序を比較しますが、
アルファベットの大文字小文字の違いを無視します。
このメソッドの動作は組み込み変数 $= には影響されません。
@param other self と比較する文字列
//emlist[例][ruby]{
"aBcDe......=> 0
"aBcDeF".casecmp("abcdefg") #=> -1
"abcdef".casecmp("ABCDEF") #=> 0
//}
nil は文字列のエンコーディングが非互換の時に返されます。
//emlist[][ruby]{
"\u{e4 f6 fc}".encode("ISO-8859-1").casecmp("\u{c4 d6 dc}") #=> nil
//}
@see String#<=>, Encoding.compatible?... -
String
# append _ as _ bytes(*objects) -> self (9050.0) -
引数で与えたオブジェクトをバイト列として、self に破壊的に連結します。
...。
//emlist[例][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-8......BIT) 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
# unicode _ normalize!(form = :nfc) -> self (9044.0) -
self を NFC、NFD、NFKC、NFKD のいずれかの正規化形式で Unicode 正規化し た文字列に置き換えます。
...なり)変換が行なわれなくても self を返します。
@param form 正規化形式を :nfc、:nfd、:nfkc、:nfkd のいずれかで指定しま
す。省略した場合は :nfc になります。
@raise Encoding::CompatibilityError self が Unicode 文字列ではない場......に発生します。
//emlist[例][ruby]{
text = "a\u0300"
text.unicode_normalize!(:nfc)
text == "\u00E0" # => true
text.unicode_normalize!(:nfd)
text == "a\u0300" # => true
//}
@see String#unicode_normalize, String#unicode_normalized?... -
String
# <<(other) -> self (9041.0) -
self に文字列 other を破壊的に連結します。 other が 整数である場合は other.chr(self.encoding) 相当の文字を末尾に追加します。
...合は 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
# concat(other) -> self (9041.0) -
self に文字列 other を破壊的に連結します。 other が 整数である場合は other.chr(self.encoding) 相当の文字を末尾に追加します。
...合は 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 (9039.0) -
self に文字列 other を破壊的に連結します。 other が 整数である場合は other.chr(self.encoding) 相当の文字を末尾に追加します。
...合は 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
# concat(other) -> self (9039.0) -
self に文字列 other を破壊的に連結します。 other が 整数である場合は other.chr(self.encoding) 相当の文字を末尾に追加します。
...合は 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 (9036.0) -
self に文字列 other を破壊的に連結します。 other が 整数である場合は other.chr(self.encoding) 相当の文字を末尾に追加します。
...合は 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
# concat(*arguments) -> self (9036.0) -
self に複数の文字列を破壊的に連結します。
...を末尾に追加します。追加する文字のエンコーディングは self.encoding です。
self を返します。
@param arguments 複数の文字列もしくは 0 以上の整数
//emlist[例][ruby]{
str = "foo"
str.concat
p str # => "foo"
str = "foo"
str.concat "bar", "baz"
p s......tr # => "foobarbaz"
str = "foo"
str.concat("!", 33, 33)
p str # => "foo!!!"
//}
@see String#append_as_bytes... -
String
# concat(other) -> self (9036.0) -
self に文字列 other を破壊的に連結します。 other が 整数である場合は other.chr(self.encoding) 相当の文字を末尾に追加します。
...合は 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
# concat(*arguments) -> self (9024.0) -
self に複数の文字列を破壊的に連結します。
...を末尾に追加します。追加する文字のエンコーディングは self.encoding です。
self を返します。
@param arguments 複数の文字列もしくは 0 以上の整数
//emlist[例][ruby]{
str = "foo"
str.concat
p str # => "foo"
str = "foo"
str.concat "bar", "baz"
p s...