321件ヒット
[1-100件を表示]
(0.110秒)
ライブラリ
- ビルトイン (310)
-
json
/ add / symbol (11)
検索結果
先頭5件
-
Symbol
# encoding -> Encoding (6201.0) -
シンボルに対応する文字列のエンコーディング情報を表現した Encoding オブ ジェクトを返します。
...シンボルに対応する文字列のエンコーディング情報を表現した Encoding オブ
ジェクトを返します。
例:
# encoding: utf-8
:foo.encoding # => #<Encoding:US-ASCII>
:あかさたな.encoding # => #<Encoding:UTF-8>
@see String#encoding... -
Symbol
# inspect -> String (6201.0) -
自身を人間に読みやすい文字列にして返します。
...自身を人間に読みやすい文字列にして返します。
:fred.inspect #=> ":fred"... -
Symbol
# start _ with?(*prefixes) -> bool (6107.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
# capitalize -> Symbol (6101.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 (6101.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 (6101.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 (6101.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 (6101.0) -
self を返します。
...self を返します。
例:
:foo.intern # => :foo
@see String#intern... -
Symbol
# size -> Integer (3101.0) -
シンボルに対応する文字列の長さを返します。
...シンボルに対応する文字列の長さを返します。
(self.to_s.length と同じです。)
:foo.length #=> 3
@see String#length, String#size... -
Symbol
# slice(nth) -> String | nil (3101.0) -
nth 番目の文字を返します。
nth 番目の文字を返します。
(self.to_s[nth] と同じです。)
@param nth 文字の位置を表す整数を指定します。
:foo[0] # => "f"
:foo[1] # => "o"
:foo[2] # => "o" -
Symbol
# slice(nth , len) -> String | nil (3101.0) -
nth 番目から長さ len の部分文字列を新しく作って返します。
nth 番目から長さ len の部分文字列を新しく作って返します。
(self.to_s[nth, len] と同じです。)
@param nth 文字の位置を表す整数を指定します。
@param len 文字列の長さを指定します。
:foo[1, 2] # => "oo" -
Symbol
# slice(range) -> String | nil (3101.0) -
rangeで指定したインデックスの範囲に含まれる部分文字列を返します。
...rangeで指定したインデックスの範囲に含まれる部分文字列を返します。
(self.to_s[range] と同じです。)
@param range 取得したい文字列の範囲を示す Range オブジェクトを指定します。
:foo[0..1] # => "fo"
@see String#[] , String#slice...