種類
- インスタンスメソッド (192)
- 特異メソッド (116)
- クラス (66)
クラス
-
ARGF
. class (33) - Encoding (11)
-
Encoding
:: Converter (33) - IO (77)
- String (135)
- Symbol (19)
キーワード
- CompatibilityError (11)
- Converter (11)
- ConverterNotFoundError (11)
- InvalidByteSequenceError (11)
- String (11)
- UndefinedConversionError (11)
- casecmp (22)
- casecmp? (16)
-
default
_ internal (11) -
each
_ codepoint (22) - encode! (22)
- encoding (11)
-
for
_ fd (11) - new (72)
- open (22)
-
set
_ encoding (66)
検索結果
先頭5件
-
String
# each _ codepoint -> Enumerator (8.0) -
文字列の各コードポイントに対して繰り返します。
...ます。
//emlist[例][ruby]{
#coding:UTF-8
"hello わーるど".each_codepoint.to_a
# => [104, 101, 108, 108, 111, 32, 12431, 12540, 12427, 12393]
"hello わーるど".encode('euc-jp').each_codepoint.to_a
# => [104, 101, 108, 108, 111, 32, 42223, 41404, 42219, 42185]
//}
@see String#codepoints... -
String
# each _ codepoint {|codepoint| block } -> self (8.0) -
文字列の各コードポイントに対して繰り返します。
...ます。
//emlist[例][ruby]{
#coding:UTF-8
"hello わーるど".each_codepoint.to_a
# => [104, 101, 108, 108, 111, 32, 12431, 12540, 12427, 12393]
"hello わーるど".encode('euc-jp').each_codepoint.to_a
# => [104, 101, 108, 108, 111, 32, 42223, 41404, 42219, 42185]
//}
@see String#codepoints... -
String
# encoding -> Encoding (8.0) -
文字列のエンコーディング情報を表現した Encoding オブジェクトを返します。
...列のエンコーディング情報を表現した Encoding オブジェクトを返します。
//emlist[例][ruby]{
# encoding: utf-8
utf8_str = "test"
euc_str = utf8_str.encode("EUC-JP")
utf8_str.encoding # => #<Encoding:UTF-8>
euc_str.encoding # => #<Encoding:EUC-JP>
//}
@see Encoding... -
String
. new(string = "") -> String (8.0) -
string と同じ内容の新しい文字列を作成して返します。 引数を省略した場合は空文字列を生成して返します。
...す。
@param string 文字列
@return 引数 string と同じ内容の文字列オブジェクト
//emlist[例][ruby]{
text = "hoge".encode("EUC-JP")
no_option = String.new(text) # => "hoge"
no_option.encoding == Encoding::EUC_JP # => true
/......ing::ASCII_8BITになります)。
@return 引数 string と同じ内容の文字列オブジェクト
//emlist[例][ruby]{
text = "hoge".encode("EUC-JP")
no_option = String.new(text) # => "hoge"
no_option.encoding == Encoding::EUC_JP # => true......string.bytesizeになります。
@return 引数 string と同じ内容の文字列オブジェクト
//emlist[例][ruby]{
text = "hoge".encode("EUC-JP")
no_option = String.new(text) # => "hoge"
no_option.encoding == Encoding::EUC_JP # => true
w... -
String
. new(string = "" , encoding: string . encoding) -> String (8.0) -
string と同じ内容の新しい文字列を作成して返します。 引数を省略した場合は空文字列を生成して返します。
...ing::ASCII_8BITになります)。
@return 引数 string と同じ内容の文字列オブジェクト
//emlist[例][ruby]{
text = "hoge".encode("EUC-JP")
no_option = String.new(text) # => "hoge"
no_option.encoding == Encoding::EUC_JP # => true... -
String
. new(string = "" , encoding: string . encoding , capacity: 127) -> String (8.0) -
string と同じ内容の新しい文字列を作成して返します。 引数を省略した場合は空文字列を生成して返します。
...string.bytesizeになります。
@return 引数 string と同じ内容の文字列オブジェクト
//emlist[例][ruby]{
text = "hoge".encode("EUC-JP")
no_option = String.new(text) # => "hoge"
no_option.encoding == Encoding::EUC_JP # => true
w... -
String
. new(string = "" , encoding: string . encoding , capacity: 63) -> String (8.0) -
string と同じ内容の新しい文字列を作成して返します。 引数を省略した場合は空文字列を生成して返します。
...string.bytesizeになります。
@return 引数 string と同じ内容の文字列オブジェクト
//emlist[例][ruby]{
text = "hoge".encode("EUC-JP")
no_option = String.new(text) # => "hoge"
no_option.encoding == Encoding::EUC_JP # => true
w... -
String
. new(string = "" , encoding: string . encoding , capacity: string . bytesize) -> String (8.0) -
string と同じ内容の新しい文字列を作成して返します。 引数を省略した場合は空文字列を生成して返します。
...string.bytesizeになります。
@return 引数 string と同じ内容の文字列オブジェクト
//emlist[例][ruby]{
text = "hoge".encode("EUC-JP")
no_option = String.new(text) # => "hoge"
no_option.encoding == Encoding::EUC_JP # => true
w... -
Symbol
# casecmp(other) -> -1 | 0 | 1 | nil (8.0) -
Symbol#<=> と同様にシンボルに対応する文字列の順序を比較しますが、 アルファベットの大文字小文字の違いを無視します。
...ボルではない場合や、文字列のエンコーディングが非互換の場合は、nil を返します。
//emlist[][ruby]{
:foo.casecmp("foo") #=> nil
"\u{e4 f6 fc}".encode("ISO-8859-1").to_sym.casecmp(:"\u{c4 d6 dc}") #=> nil
//}
@see String#casecmp, Symbol#<=>, Symbol#casecmp?... -
Symbol
# casecmp?(other) -> bool | nil (8.0) -
大文字小文字の違いを無視しシンボルを比較します。 シンボルが一致する場合には true を返し、一致しない場合には false を返します。
...er がシンボルではない場合や、文字列のエンコーディングが非互換の場合は、nil を返します。
//emlist[][ruby]{
:foo.casecmp?("foo") #=> nil
"\u{e4 f6 fc}".encode("ISO-8859-1").to_sym.casecmp?(:"\u{c4 d6 dc}") #=> nil
//}
@see String#casecmp?, Symbol#casecmp...