るりまサーチ

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

別のキーワード

  1. _builtin to_i
  2. fiddle to_i
  3. matrix elements_to_i
  4. matrix i
  5. csv to_i

ライブラリ

キーワード

検索結果

<< 1 2 3 ... > >>

Symbol#encoding -> Encoding (6313.0)

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

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

例:

# encoding: utf-8

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

@see String#encoding...

Symbol#inspect -> String (6301.0)

自身を人間に読みやすい文字列にして返します。

...自身を人間に読みやすい文字列にして返します。

:fred.inspect #=> ":fred"...

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

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

...fixes のいずれかであるとき 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#<=>(other) -> -1 | 0 | 1 | nil (6201.0)

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

...を ASCII コード順で比較して、
self が小さい時には -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#capitalize -> Symbol (6201.0)

シンボルに対応する文字列の先頭の文字を大文字に、残りを小文字に変更した シンボルを返します。

...に、残りを小文字に変更した
シンボルを返します。

(self.to_s.capitalize.intern と同じです。)

:foobar.capitalize #=> :Foobar
:fooBar.capitalize #=> :Foobar
:FOOBAR.capitalize #=> :Foobar
:"foobar--".capitalize # => "Foobar--"

@see String#capitalize...

絞り込み条件を変える

Symbol#capitalize(*options) -> Symbol (6201.0)

シンボルに対応する文字列の先頭の文字を大文字に、残りを小文字に変更した シンボルを返します。

...に、残りを小文字に変更した
シンボルを返します。

(self.to_s.capitalize.intern と同じです。)

:foobar.capitalize #=> :Foobar
:fooBar.capitalize #=> :Foobar
:FOOBAR.capitalize #=> :Foobar
:"foobar--".capitalize # => "Foobar--"

@see String#capitalize...

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

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

...ffixes のいずれかであるとき 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+ matches.
:hello.end_with?("heaven", "ello") #=> true
:hello.end_with?("heaven", "paradise") #=> false
//}...

Symbol#id2name -> String (6201.0)

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

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

逆に、文字列に対応するシンボルを得るには
String#intern を使います。

p :foo.id2name # => "foo"
p :foo.id2name.intern == :foo # => true

@see String#intern...
...シンボルに対応する文字列を返します。

逆に、文字列に対応するシンボルを得るには
String#intern を使います。

p :foo.id2name # => "foo"
p :foo.id2name.intern == :foo # => true

@see String#intern
@see Symbol#name...

Symbol#intern -> self (6201.0)

self を返します。

...self を返します。

例:

:foo.intern # => :foo

@see String#intern...

Symbol#size -> Integer (3201.0)

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

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

(self.to_s.length と同じです。)

:foo.length #=> 3

@see String#length, String#size...

絞り込み条件を変える

Symbol#slice(nth) -> String | nil (3201.0)

nth 番目の文字を返します。

...nth 番目の文字を返します。

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

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

:foo[0] # => "f"
:foo[1] # => "o"
:foo[2] # => "o"...

Symbol#slice(nth, len) -> String | nil (3201.0)

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

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

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

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

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