るりまサーチ

最速Rubyリファレンスマニュアル検索!
52件ヒット [1-52件を表示] (0.072秒)
トップページ > クエリ:l[x] > クエリ:FALSE[x] > クラス:Symbol[x]

別のキーワード

  1. matrix l
  2. kernel $-l
  3. _builtin $-l
  4. lupdecomposition l
  5. l

ライブラリ

キーワード

検索結果

Symbol#casecmp?(other) -> bool | nil (3229.0)

大文字小文字の違いを無視しシンボルを比較します。 シンボルが一致する場合には true を返し、一致しない場合には false を返します。

...を返し、一致しない場合には false を返します。

@param other 比較対象のシンボルを指定します。

//emlist[][ruby]{
:abcdef.casecmp?(:abcde) #=> false
:aBcDeF.casecmp?(:abcdef) #=> true
:abcdef.casecmp?(:abcdefg) #=> false
:abcdef.casecmp?(:ABCDEF) #=> true...
...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#==(other) -> true | false (3208.0)

other が同じシンボルの時に真を返します。 そうでない場合は偽を返します。

...other が同じシンボルの時に真を返します。
そうでない場合は偽を返します。

@param other 比較対象のシンボルを指定します。

例:

:aaa == :aaa #=> true
:aaa == :xxx #=> false...

Symbol#match?(regexp, pos = 0) -> bool (3113.0)

regexp.match?(self, pos) と同じです。 regexp が文字列の場合は、正規表現にコンパイルします。 詳しくは Regexp#match? を参照してください。

...p.match?(self, pos) と同じです。
regexp が文字列の場合は、正規表現にコンパイルします。
詳しくは Regexp#match? を参照してください。

例:

:Ruby.match?(/R.../) # => true
:Ruby.match?('Ruby') # => true
:Ruby.match?('Ruby',1) # => false
:Ruby.ma...
...tch?('uby',1) # => true
:Ruby.match?(/P.../) # => false
$& # => nil

@see Regexp#match?, String#match?...

Symbol#empty? -> bool (3107.0)

自身が :"" (length が 0 のシンボル)かどうかを返します。

...自身が :"" (length が 0 のシンボル)かどうかを返します。

:"".empty? #=> true
:foo.empty? #=> false

@see String#empty?...

Symbol#end_with?(*suffixes) -> bool (3107.0)

self の末尾が suffixes のいずれかであるとき true を返します。

...self の末尾が suffixes のいずれかであるとき true を返します。

(self.to_s.end_with?と同じです。)

@param suffixes パターンを表す文字列 (のリスト)

@see Symbol#start_with?

@see String#end_with?

//emlist[][ruby]{
:hello.end_with?("ello") #=> tru...
...e

# returns true if one of the +suffixes+ matches.
:hello.end_with?("heaven", "ello") #=> true
:hello.end_with?("heaven", "paradise") #=> false
//}...

絞り込み条件を変える

Symbol#start_with?(*prefixes) -> bool (3107.0)

self の先頭が prefixes のいずれかであるとき true を返します。

...elf の先頭が 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) #=> true

# returns true if one of the prefixes matches.
:hello.start_with?("heaven", "hell") #=> true
:hello.start_with?("heaven", "paradise") #=> false
//}...

Symbol#name -> String (3007.0)

シンボルに対応する文字列を返します。

...シンボルに対応する文字列を返します。

Symbol
#to_sと違って freeze された文字列を返します。

//emlist[][ruby]{
p :fred.name # => "fred"
p :fred.name.frozen? # => true
p :fred.to_s # => "fred"
p :fred.to_s.frozen? # => false
//}

@see Symbol#to_s...