150件ヒット
[1-100件を表示]
(0.137秒)
ライブラリ
- ビルトイン (150)
検索結果
先頭5件
-
Symbol
# start _ with?(*prefixes) -> bool (12213.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 (12201.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
# length -> Integer (6201.0) -
シンボルに対応する文字列の長さを返します。
...シンボルに対応する文字列の長さを返します。
(self.to_s.length と同じです。)
:foo.length #=> 3
@see String#length, String#size... -
Symbol
# match(other) -> Integer | nil (6201.0) -
正規表現 other とのマッチを行います。
...正規表現 other とのマッチを行います。
(self.to_s.match(other) と同じです。)
@param other 比較対象のシンボルを指定します。
@return マッチが成功すればマッチした位置を、そうでなければ nil を返します。
p :foo.match(/foo/) # =>......0
p :foobar.match(/bar/) # => 3
p :foo.match(/bar/) # => nil
@see String#match... -
Symbol
# match(other) -> MatchData | nil (6201.0) -
正規表現 other とのマッチを行います。
...her とのマッチを行います。
(self.to_s.match(other) と同じです。)
@param other 比較対象のシンボルを指定します。
@return マッチが成功すれば MatchData オブジェクトを、そうでなければ nil を返します。
p :foo.match(/foo/) # => #<Match......Data "foo">
p :foobar.match(/bar/) # => #<MatchData "bar">
p :foo.match(/bar/) # => nil
@see String#match
@see Symbol#match?... -
Symbol
# size -> Integer (6101.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"... -
Symbol
# slice(regexp , nth = 0) -> String | nil (3201.0) -
正規表現 regexp の nth 番目の括弧にマッチする最初の部分文字列を返します。
...正規表現 regexp の nth 番目の括弧にマッチする最初の部分文字列を返します。
(self.to_s[regexp, nth] と同じです。)
@param regexp 正規表現を指定します。
@param nth 取得したい正規表現レジスタのインデックスを指定します。
:foo... -
Symbol
# <=>(other) -> -1 | 0 | 1 | nil (201.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
# =~(other) -> Integer | nil (201.0) -
正規表現 other とのマッチを行います。
...正規表現 other とのマッチを行います。
(self.to_s =~ other と同じです。)
@param other 比較対象のシンボルを指定します。
@return マッチが成功すればマッチした位置のインデックスを、そうでなければ nil を返します。
p :foo =~....../foo/ # => 0
p :foobar =~ /bar/ # => 3
p :foo =~ /bar/ # => nil
@see String#=~... -
Symbol
# [](nth) -> String | nil (201.0) -
nth 番目の文字を返します。
...nth 番目の文字を返します。
(self.to_s[nth] と同じです。)
@param nth 文字の位置を表す整数を指定します。
:foo[0] # => "f"
:foo[1] # => "o"
:foo[2] # => "o"...