185件ヒット
[101-185件を表示]
(0.019秒)
キーワード
- == (12)
- === (12)
-
ascii
_ only? (12) - casecmp? (9)
- empty? (12)
-
end
_ with? (12) - eql? (12)
- include? (12)
- iseuc (12)
- isjis (12)
- issjis (12)
- isutf8 (12)
- match? (9)
-
start
_ with? (12) -
unicode
_ normalized? (11) -
valid
_ encoding? (12)
検索結果
先頭5件
-
String
# iseuc -> bool (102.0) -
self が EUC-JP なバイト列として正当であるかどうかを判定します。
self が EUC-JP なバイト列として正当であるかどうかを判定します。
Kconv.#iseuc(self) と同じです。
//emlist[例][ruby]{
require 'kconv'
euc_str = "\
\xa5\xaa\xa5\xd6\xa5\xb8\xa5\xa7\xa5\xaf\xa5\xc8\xbb\xd8\xb8\xfe\
\xa5\xd7\xa5\xed\xa5\xb0\xa5\xe9\xa5\xdf\xa5\xf3\xa5\xb0\xb8\xc0\xb8\xec\
\x52\x75\x62\x79".force_encoding('EUC-JP')
... -
String
# isjis -> bool (102.0) -
self が ISO-2022-JP なバイト列として正当であるかどうかを判定します。
self が ISO-2022-JP なバイト列として正当であるかどうかを判定します。
Kconv.isjis(self) と同じです。 -
String
# issjis -> bool (102.0) -
self が Shift_JIS なバイト列として正当であるかどうかを判定します。
self が Shift_JIS なバイト列として正当であるかどうかを判定します。
Kconv.#issjis と同じです。 -
String
# isutf8 -> bool (102.0) -
self が UTF-8 なバイト列として正当であるかどうかを判定します。
self が UTF-8 なバイト列として正当であるかどうかを判定します。
Kconv.#isutf8(self) と同じです。 -
String
# match?(regexp , pos = 0) -> bool (102.0) -
regexp.match?(self, pos) と同じです。 regexp が文字列の場合は、正規表現にコンパイルします。 詳しくは Regexp#match? を参照してください。
regexp.match?(self, pos) と同じです。
regexp が文字列の場合は、正規表現にコンパイルします。
詳しくは Regexp#match? を参照してください。
//emlist[例][ruby]{
"Ruby".match?(/R.../) #=> true
"Ruby".match?(/R.../, 1) #=> false
"Ruby".match?(/P.../) #=> false
$& #=> nil
//}
@see Regexp#match?, Symbol#match? -
String
# start _ with?(*prefixes) -> bool (102.0) -
self の先頭が prefixes のいずれかであるとき true を返します。
..."string".start_with?("str") # => true
"string".start_with?("ing") # => false
"string".start_with?("ing", "str") # => true
"string".start_with?(/\w/) # => true
"string".start_with?(/\d/) # => false
//}
@see String#end_with?
@see String#delete_prefix, String#d... -
String
# start _ with?(*strs) -> bool (102.0) -
self の先頭が strs のいずれかであるとき true を返します。
...れかであるとき true を返します。
@param strs パターンを表す文字列 (のリスト)
//emlist[例][ruby]{
"string".start_with?("str") # => true
"string".start_with?("ing") # => false
"string".start_with?("ing", "str") # => true
//}
@see String#end_with?... -
String
# unicode _ normalized?(form = :nfc) -> bool (102.0) -
self が引数 form で指定された正規化形式で Unicode 正規化された文字列か どうかを返します。
...=> 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
# valid _ encoding? -> bool (102.0) -
文字列の内容が、現在のエンコーディングに照らしあわせて妥当であれば true を返します。そうでない場合は false を返します。
文字列の内容が、現在のエンコーディングに照らしあわせて妥当であれば
true を返します。そうでない場合は false を返します。
//emlist[例][ruby]{
"\xc2\xa1".force_encoding("UTF-8").valid_encoding? #=> true
"\xc2".force_encoding("UTF-8").valid_encoding? #=> false
"\x80".force_encoding("UTF-8").valid_encoding? #=> false
//}