るりまサーチ

最速Rubyリファレンスマニュアル検索!
275件ヒット [201-275件を表示] (0.250秒)
トップページ > クラス:String[x] > クエリ:_builtin[x] > クエリ:encoding[x]

別のキーワード

  1. _builtin new
  2. _builtin inspect
  3. _builtin []
  4. _builtin to_s
  5. _builtin each

ライブラリ

キーワード

検索結果

<< < 1 2 3 >>

String#unicode_normalize(form = :nfc) -> String (8019.0)

self を NFC、NFD、NFKC、NFKD のいずれかの正規化形式で Unicode 正規化し た文字列を返します。

...規化形式を :nfc、:nfd、:nfkc、:nfkd のいずれかで指定しま
す。省略した場合は :nfc になります。

@raise Encoding::CompatibilityError self が Unicode 文字列ではない場合
に発生します。

このメソッド...
...# => 'à' ("\u00E0" と同じ)
"\u00E0".unicode_normalize(:nfd) # => 'à' ("a\u0300" と同じ)
"\xE0".force_encoding('ISO-8859-1').unicode_normalize(:nfd)
# => Encoding::CompatibilityError raised
//}

@see String#unicode_normalize!, String#unicode_normalized?...

String#unicode_normalized?(form = :nfc) -> bool (8019.0)

self が引数 form で指定された正規化形式で Unicode 正規化された文字列か どうかを返します。

...規化形式を :nfc、:nfd、:nfkc、:nfkd のいずれかで指定しま
す。省略した場合は :nfc になります。

@raise Encoding::CompatibilityError self が Unicode 文字列ではない場合
に発生します。

//emlist[例][ruby]{...
...=> true
"\u00E0".unicode_normalized? # => true
"\u00E0".unicode_normalized?(:nfd) # => false
"\xE0".force_encoding('ISO-8859-1').unicode_normalized?
# => Encoding::CompatibilityError raised
//}

@see String#unicode_normalize, String#unicode_normalize!...

String#unpack(template) -> Array (8019.0)

Array#pack で生成された文字列を テンプレート文字列 template にしたがってアンパックし、 それらの要素を含む配列を返します。

...@param template pack テンプレート文字列
@return オブジェクトの配列


以下にあげるものは、Array#pack、String#unpack
のテンプレート文字の一覧です。テンプレート文字は後に「長さ」を表す数字
を続けることができます...
...!<: little endian signed long
//}

=== 各テンプレート文字の説明

説明中、Array#pack と String#unpack で違いのあるものは `/' で区切って
「Array#pack の説明 / String#unpack の説明」としています。

: a

ASCII文字列(ヌル文字を詰める/後続する...
...HSElKS0xNTk9QUVJTVFVWV1hZWg==".unpack("m0")
# => ["abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"]
//}
@see base64

: M

quoted-printable encoding された文字列
//emlist[][ruby]{
["a b c\td \ne"].pack("M") # => "a b c\td =\n\ne=\n"

"a b c\td =\n\ne=\n".unpack("M") # => ["a b c\td \ne"...
...m template pack テンプレート文字列
@return オブジェクトの配列


以下にあげるものは、Array#pack、String#unpack、String#unpack1
のテンプレート文字の一覧です。テンプレート文字は後に「長さ」を表す数字
を続けることがで...

String#<<(other) -> self (8018.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 (8018.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 (8017.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 (8017.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.new(string = "") -> String (8013.0)

string と同じ内容の新しい文字列を作成して返します。 引数を省略した場合は空文字列を生成して返します。

...
string
と同じ内容の新しい文字列を作成して返します。
引数を省略した場合は空文字列を生成して返します。

@param string 文字列
@return 引数 string と同じ内容の文字列オブジェクト

//emlist[例][ruby]{
text = "hoge".encode("EUC-J...
...P")
no_option = String.new(text) # => "hoge"
no_option.encoding == Encoding::EUC_JP # => true
//}...

String#concat(*arguments) -> self (8008.0)

self に複数の文字列を破壊的に連結します。

...である場合は Integer#chr の結果に相当する文字を末尾に追加します。追加する文字のエンコーディングは self.encoding です。

self を返します。

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

//emlist[例][ruby]{
str = "foo"
str.concat...

String#casecmp(other) -> -1 | 0 | 1 | nil (8007.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
#<=> と同様に文字列の順序を比較しますが、
アルファベットの大文字小文字の違いを無視します。

このメソッドの動作は組み込み変数 $= には影響されません。

String
#casecmp? と違って大文字小文字の違いを無視するの...
...#=> 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#unicode_normalize!(form = :nfc) -> self (8007.0)

self を NFC、NFD、NFKC、NFKD のいずれかの正規化形式で Unicode 正規化し た文字列に置き換えます。

...規化形式を :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?...
<< < 1 2 3 >>