6件ヒット
[1-6件を表示]
(0.035秒)
検索結果
先頭5件
-
Symbol
# ==(other) -> true | false (331.0) -
other が同じシンボルの時に真を返します。 そうでない場合は偽を返します。
other が同じシンボルの時に真を返します。
そうでない場合は偽を返します。
@param other 比較対象のシンボルを指定します。
例:
:aaa == :aaa #=> true
:aaa == :xxx #=> false -
Symbol
# casecmp?(other) -> bool | nil (94.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... -
Symbol
# match?(regexp , pos = 0) -> bool (46.0) -
regexp.match?(self, pos) と同じです。 regexp が文字列の場合は、正規表現にコンパイルします。 詳しくは Regexp#match? を参照してください。
regexp.match?(self, pos) と同じです。
regexp が文字列の場合は、正規表現にコンパイルします。
詳しくは Regexp#match? を参照してください。
例:
:Ruby.match?(/R.../) # => true
:Ruby.match?('Ruby') # => true
:Ruby.match?('Ruby',1) # => false
:Ruby.match?('uby',1) # => true
:Ruby.match?(/P.../) # => false
$& ... -
Symbol
# empty? -> bool (28.0) -
自身が :"" (length が 0 のシンボル)かどうかを返します。
自身が :"" (length が 0 のシンボル)かどうかを返します。
:"".empty? #=> true
:foo.empty? #=> false
@see String#empty? -
Symbol
# end _ with?(*suffixes) -> bool (28.0) -
self の末尾が suffixes のいずれかであるとき true を返します。
...あるとき true を返します。
(self.to_s.end_with?と同じです。)
@param suffixes パターンを表す文字列 (のリスト)
@see Symbol#start_with?
@see String#end_with?
//emlist[][ruby]{
:hello.end_with?("ello") #=> true
# returns true if one of the +suffixes+ mat... -
Symbol
# start _ with?(*prefixes) -> bool (28.0) -
self の先頭が prefixes のいずれかであるとき true を返します。
...します。
(self.to_s.start_with?と同じです。)
@param prefixes パターンを表す文字列または正規表現 (のリスト)
@see Symbol#end_with?
@see String#start_with?
//emlist[][ruby]{
:hello.start_with?("hell") #=> true
:hello.start_with?(/H/i) #=...