るりまサーチ

最速Rubyリファレンスマニュアル検索!
407件ヒット [1-100件を表示] (0.106秒)

別のキーワード

  1. _builtin -
  2. open-uri open
  3. irb/input-method new
  4. irb/input-method gets
  5. matrix -

ライブラリ

キーワード

検索結果

<< 1 2 3 ... > >>

Symbol#casecmp(other) -> -1 | 0 | 1 | nil (145.0)

Symbol#<=> と同様にシンボルに対応する文字列の順序を比較しますが、 アルファベットの大文字小文字の違いを無視します。

...
Symbol
#<=> と同様にシンボルに対応する文字列の順序を比較しますが、
アルファベットの大文字小文字の違いを無視します。

Symbol
#casecmp? と違って大文字小文字の違いを無視するのは
Unicode 全体ではなく、A-Z/a-z だけです。

@
...
...=> -1
:abcdef.casecmp(:ABCDEF) #=> 0
:"\u{e4 f6 fc}".casecmp(:"\u{c4 d6 dc}") #=> 1
//}

other がシンボルではない場合や、文字列のエンコーディングが非互換の場合は、nil を返します。

//emlist[][ruby]{
:foo.casecmp("foo") #=> nil
"\u{e4 f6 fc}".encode("ISO-8...
...859-1").to_sym.casecmp(:"\u{c4 d6 dc}") #=> nil
//}

@
see String#casecmp, Symbol#<=>, Symbol#casecmp?...

Symbol#<=>(other) -> -1 | 0 | 1 | nil (137.0)

self と other のシンボルに対応する文字列を ASCII コード順で比較して、 self が小さい時には -1、等しい時には 0、大きい時には 1 を返します。

...が小さい時には -1、等しい時には 0、大きい時には 1 を返します。

other がシンボルではなく比較できない時には nil を返します。

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

//emlist[][ruby]{
p :aaa <=> :xxx # => -1
p :aaa <=> :aaa #...
...=> 0
p :xxx <=> :aaa # => 1
p :foo <=> "foo" # => nil
//}

@
see String#<=>, Symbol#casecmp...

Symbol#casecmp(other) -> -1 | 0 | 1 | nil (133.0)

Symbol#<=> と同様にシンボルに対応する文字列の順序を比較しますが、 アルファベットの大文字小文字の違いを無視します。

...
Symbol
#<=> と同様にシンボルに対応する文字列の順序を比較しますが、
アルファベットの大文字小文字の違いを無視します。


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

//emlist[][ruby]{
:aBcDeF.casecmp(:abcde) #=> 1
:aBcDeF.casecmp(...
...=> -1
:abcdef.casecmp(:ABCDEF) #=> 0
:"\u{e4 f6 fc}".casecmp(:"\u{c4 d6 dc}") #=> 1
//}

other がシンボルではない場合や、文字列のエンコーディングが非互換の場合は、nil を返します。

//emlist[][ruby]{
:foo.casecmp("foo") #=> nil
"\u{e4 f6 fc}".encode("ISO-8...
...859-1").to_sym.casecmp(:"\u{c4 d6 dc}") #=> nil
//}

@
see String#casecmp, Symbol#<=>, Symbol#casecmp?...

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

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

...視しシンボルを比較します。
シンボルが一致する場合には true を返し、一致しない場合には false を返します。

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

//emlist[][ruby]{
:abcdef.casecmp?(:abcde) #=> false
:aBcDeF.casecmp?(:abcdef)...
...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#encoding -> Encoding (126.0)

シンボルに対応する文字列のエンコーディング情報を表現した Encoding オブ ジェクトを返します。

...シンボルに対応する文字列のエンコーディング情報を表現した Encoding オブ
ジェクトを返します。

例:

# encoding: utf-8

:foo.encoding # => #<Encoding:US-ASCII>
:あかさたな.encoding # => #<Encoding:UTF-8>

@
see String#encoding...

絞り込み条件を変える

Symbol#match(other) -> MatchData | nil (126.0)

正規表現 other とのマッチを行います。

...正規表現 other とのマッチを行います。

(self.to_s.match(other) と同じです。)

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

@
return マッチが成功すれば MatchData オブジェクトを、そうでなければ nil を返します。

p :foo.match(/foo/)...
...# => #<MatchData "foo">
p :foobar.match(/bar/) # => #<MatchData "bar">
p :foo.match(/bar/) # => nil

@
see String#match
@
see Symbol#match?...

Symbol#=~(other) -> Integer | nil (120.0)

正規表現 other とのマッチを行います。

...す。)

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

@
return マッチが成功すればマッチした位置のインデックスを、そうでなければ nil を返します。

p :foo =~ /foo/ # => 0
p :foobar =~ /bar/ # => 3
p :foo =~ /bar/ # => nil

@
see String#...

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

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

...suffixes のいずれかであるとき 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...

Symbol#match(other) -> Integer | nil (120.0)

正規表現 other とのマッチを行います。

...じです。)

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

@
return マッチが成功すればマッチした位置を、そうでなければ nil を返します。

p :foo.match(/foo/) # => 0
p :foobar.match(/bar/) # => 3
p :foo.match(/bar/) # => nil

@
see String#mat...

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

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

...いずれかであるとき true を返します。

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

@
param prefixes パターンを表す文字列または正規表現 (のリスト)

@
see Symbol#end_with?

@
see String#start_with?

//emlist[][ruby]{
:hello.start_with?("hell") #=> true
:hel...

絞り込み条件を変える

Symbol#[](nth, len) -> String | nil (119.0)

nth 番目から長さ len の部分文字列を新しく作って返します。

...nth 番目から長さ len の部分文字列を新しく作って返します。

(self.to_s[nth, len] と同じです。)

@
param nth 文字の位置を表す整数を指定します。
@
param len 文字列の長さを指定します。

:foo[1, 2] # => "oo"...

Symbol#[](range) -> String | nil (119.0)

rangeで指定したインデックスの範囲に含まれる部分文字列を返します。

...rangeで指定したインデックスの範囲に含まれる部分文字列を返します。

(self.to_s[range] と同じです。)

@
param range 取得したい文字列の範囲を示す Range オブジェクトを指定します。

:foo[0..1] # => "fo"

@
see String#[] , String#slice...
<< 1 2 3 ... > >>