342件ヒット
[201-300件を表示]
(0.072秒)
クラス
-
ARGF
. class (36) - IO (36)
- String (129)
- StringScanner (60)
- Symbol (21)
モジュール
キーワード
- casecmp (24)
- casecmp? (18)
-
content
_ encoded (12) -
content
_ encoded= (12) -
each
_ codepoint (24) - encode! (24)
- encoding (12)
- form (24)
-
get
_ byte (12) - getbyte (12)
- getch (12)
- match? (12)
-
matched
_ size (12) -
set
_ encoding (72) -
to
_ json _ raw _ object (12) - tolocale (12)
検索結果
先頭5件
-
IO
# set _ encoding(ext _ enc) -> self (7.0) -
IO のエンコーディングを設定します。
...で外部エンコーディングを内部エンコーディングに変換する際の
オプションを指定します。
詳しくは String#encode を参照してください。
@param enc_str エンコーディングを表す文字列を指定します。"A:B" のようにコロンで区切... -
IO
# set _ encoding(ext _ enc , int _ enc , **opts) -> self (7.0) -
IO のエンコーディングを設定します。
...で外部エンコーディングを内部エンコーディングに変換する際の
オプションを指定します。
詳しくは String#encode を参照してください。
@param enc_str エンコーディングを表す文字列を指定します。"A:B" のようにコロンで区切... -
String
# casecmp(other) -> -1 | 0 | 1 | nil (7.0) -
String#<=> と同様に文字列の順序を比較しますが、 アルファベットの大文字小文字の違いを無視します。
...=> 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?......#=> 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
# casecmp?(other) -> bool | nil (7.0) -
大文字小文字の違いを無視し文字列を比較します。 文字列が一致する場合には true を返し、一致しない場合には false を返します。
...false
"abcdef".casecmp?("ABCDEF") #=> true
"\u{e4 f6 fc}".casecmp?("\u{c4 d6 dc}") #=> true
//}
nil は文字列のエンコーディングが非互換の時に返されます。
//emlist[][ruby]{
"\u{e4 f6 fc}".encode("ISO-8859-1").casecmp?("\u{c4 d6 dc}") #=> nil
//}
@see String#casecmp... -
String
# each _ codepoint -> Enumerator (7.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 (7.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 (7.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
# tolocale -> String (7.0) -
self のエンコーディングをロケールエンコーディングに変換した文字列を 返します。変換元のエンコーディングは文字列の内容から推測します。
...は Encoding.locale_charmap を見てください。
このメソッドは MIME エンコードされた文字列を展開し、
いわゆる半角カナを全角に変換します。
これらを変換したくない場合は、 String#encode
を使ってください。
@see Kconv.#tolocale... -
StringScanner
# get _ byte -> String | nil (7.0) -
1 バイトスキャンして文字列で返します。 スキャンポインタをその後ろに進めます。 スキャンポインタが文字列の末尾を指すなら nil を返します。
...StringScanner#get_byte を使ってください。
//emlist[例][ruby]{
require 'strscan'
utf8 = "\u{308B 3073 3044}"
s = StringScanner.new(utf8.encode("EUC-JP"))
p s.get_byte #=> "\xA4"
p s.get_byte #=> "\xEB"
p s.get_byte #=> "\xA4"
p s.get_byte #=> "\xD3"
p s.get_byte... -
StringScanner
# getbyte -> String | nil (7.0) -
1 バイトスキャンして文字列で返します。 スキャンポインタをその後ろに進めます。 スキャンポインタが文字列の末尾を指すなら nil を返します。
...StringScanner#get_byte を使ってください。
//emlist[例][ruby]{
require 'strscan'
utf8 = "\u{308B 3073 3044}"
s = StringScanner.new(utf8.encode("EUC-JP"))
p s.get_byte #=> "\xA4"
p s.get_byte #=> "\xEB"
p s.get_byte #=> "\xA4"
p s.get_byte #=> "\xD3"
p s.get_byte...