282件ヒット
[1-100件を表示]
(0.042秒)
別のキーワード
ライブラリ
- ビルトイン (282)
検索結果
先頭5件
-
Symbol
# intern -> self (119.0) -
self を返します。
...self を返します。
例:
:foo.intern # => :foo
@see String#intern... -
Symbol
# to _ sym -> self (119.0) -
self を返します。
...self を返します。
例:
:foo.intern # => :foo
@see String#intern... -
Symbol
# <=>(other) -> -1 | 0 | 1 | nil (33.0) -
self と other のシンボルに対応する文字列を ASCII コード順で比較して、 self が小さい時には -1、等しい時には 0、大きい時には 1 を返します。
...
self と other のシンボルに対応する文字列を 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
# [](substr) -> String | nil (27.0) -
self が substr を含む場合、一致した文字列を新しく作って返します。
...
self が substr を含む場合、一致した文字列を新しく作って返します。
(self.to_s[substr] と同じです。)
例:
:foobar.slice("foo") # => "foo"
:foobar.slice("baz") # => nil... -
Symbol
# slice(substr) -> String | nil (27.0) -
self が substr を含む場合、一致した文字列を新しく作って返します。
...
self が substr を含む場合、一致した文字列を新しく作って返します。
(self.to_s[substr] と同じです。)
例:
:foobar.slice("foo") # => "foo"
:foobar.slice("baz") # => nil... -
Symbol
# end _ with?(*suffixes) -> bool (23.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... -
Symbol
# start _ with?(*prefixes) -> bool (23.0) -
self の先頭が prefixes のいずれかであるとき true を返します。
...
self の先頭が prefixes のいずれかであるとき true を返します。
(self.to_s.start_with?と同じです。)
@param prefixes パターンを表す文字列または正規表現 (のリスト)
@see Symbol#end_with?
@see String#start_with?
//emlist[][ruby]{
:hello.start_with?("hel... -
Symbol
# to _ proc -> Proc (23.0) -
self に対応する Proc オブジェクトを返します。
...self に対応する Proc オブジェクトを返します。
生成される Proc オブジェクトを呼びだす(Proc#call)と、
Proc#callの第一引数をレシーバとして、 self という名前のメソッドを
残りの引数を渡して呼びだします。
//emlist[明示的に......self に対応する Proc オブジェクトを返します。
生成される Proc オブジェクトを呼びだす(Proc#call)と、
Proc#callの第一引数をレシーバとして、 self という名前のメソッドを
残りの引数を渡して呼びだします。
生成される Proc... -
Symbol
# match?(regexp , pos = 0) -> bool (17.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
:R... -
Symbol
# [](nth) -> String | nil (12.0) -
nth 番目の文字を返します。
...nth 番目の文字を返します。
(self.to_s[nth] と同じです。)
@param nth 文字の位置を表す整数を指定します。
:foo[0] # => "f"
:foo[1] # => "o"
:foo[2] # => "o"... -
Symbol
# [](nth , len) -> String | nil (12.0) -
nth 番目から長さ len の部分文字列を新しく作って返します。
...nth 番目から長さ len の部分文字列を新しく作って返します。
(self.to_s[nth, len] と同じです。)
@param nth 文字の位置を表す整数を指定します。
@param len 文字列の長さを指定します。
:foo[1, 2] # => "oo"...