るりまサーチ

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

別のキーワード

  1. _builtin to_i
  2. fiddle to_i
  3. matrix elements_to_i
  4. matrix i
  5. kernel $-i

ライブラリ

キーワード

検索結果

<< 1 2 3 ... > >>

Symbol#encoding -> Encoding (6208.0)

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

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

例:

# encoding: utf-8

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

@
see String#encoding...

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

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

...先頭が 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#end_with?(*suffixes) -> bool (6120.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 (6114.0)

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

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

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

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

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

Symbol#capitalize -> Symbol (6108.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 (6108.0)

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

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

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

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

@
see String#capitalize...

Symbol#id2name -> String (6108.0)

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

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

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

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

@
see String#intern...

Symbol#intern -> self (6108.0)

self を返します。

...self を返します。

例:

:foo.intern # => :foo

@
see String#intern...

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

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

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

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

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

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

Symbol#slice(range) -> String | nil (3119.0)

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

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

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

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

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

@
see String#[] , String#slice...

絞り込み条件を変える

Symbol#slice(regexp, nth = 0) -> String | nil (3119.0)

正規表現 regexp の nth 番目の括弧にマッチする最初の部分文字列を返します。

...nth 番目の括弧にマッチする最初の部分文字列を返します。

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

@
param regexp 正規表現を指定します。

@
param nth 取得したい正規表現レジスタのインデックスを指定します。

:foobar[/bar/] # => "bar"
:...

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

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

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

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

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

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