ライブラリ
- ビルトイン (1203)
クラス
-
ARGF
. class (33) - Array (77)
- BasicObject (11)
- Bignum (6)
- Complex (11)
- Data (4)
- Encoding (22)
-
Enumerator
:: Lazy (20) - Exception (22)
- FalseClass (22)
- Fixnum (6)
- Float (42)
- Hash (88)
- IO (33)
- Integer (22)
- MatchData (11)
- Method (22)
- Module (33)
- NameError (11)
- NilClass (11)
- Object (70)
- Proc (22)
-
Process
:: Status (11) - Range (22)
- Rational (22)
- Regexp (22)
- String (99)
- Struct (22)
- Symbol (278)
- Thread (36)
-
Thread
:: Backtrace :: Location (22) - Time (16)
- TrueClass (11)
- UnboundMethod (33)
- UncaughtThrowError (10)
キーワード
- % (11)
- << (11)
- =~ (11)
- [] (55)
-
add
_ trace _ func (11) - capitalize (11)
-
define
_ singleton _ method (22) - downcase (11)
-
end
_ with? (5) - grep (11)
-
grep
_ v (9) - hex (11)
- id2name (11)
- inspect (185)
- intern (11)
- join (11)
- length (11)
- match (11)
-
method
_ missing (11) - name (26)
- next (11)
-
next
_ float (10) - oct (11)
- owner (11)
-
prev
_ float (10) -
set
_ trace _ func (11) - size (11)
- slice (55)
-
start
_ with? (5) - succ (11)
- swapcase (11)
- syswrite (11)
- then (12)
-
to
_ f (11) -
to
_ i (11) -
to
_ proc (11) -
to
_ str (22) -
to
_ sym (22) -
transform
_ keys (17) -
transform
_ keys! (17) -
transform
_ values (16) -
transform
_ values! (16) - uniq (22)
- uniq! (22)
- upcase (11)
- write (22)
-
yield
_ self (14)
検索結果
先頭5件
-
Rational
# inspect -> String (8007.0) -
自身を人間が読みやすい形の文字列表現にして返します。
...に10進数の表記を返します。
@return 有理数の表記にした文字列を返します。
//emlist[例][ruby]{
Rational(5, 8).inspect # => "(5/8)"
Rational(2).inspect # => "(2/1)"
Rational(-8, 6).inspect # => "(-4/3)"
Rational(0.5).inspect # => "(1/2)"
//}
@see Rational#to_s... -
String
# %(args) -> String (8007.0) -
printf と同じ規則に従って args をフォーマットします。
...グ `-' と幅 の指定だけが意味を持ちます。
: s
文字列を出力します。
引数が String オブジェクトでなければ to_s メソッドにより文字列化
したものを引数として扱います。
: p
Object#inspect の結果を出力します。
//emlist[][r... -
String
# hex -> Integer (8007.0) -
文字列に 16 進数で数値が表現されていると解釈して整数に変換します。 接頭辞 "0x", "0X" とアンダースコアは無視されます。 文字列が [_0-9a-fA-F] 以外の文字を含むときはその文字以降を無視します。
...# => 0
p "10z".hex # => 16
p "1_0".hex # => 16
p "".hex # => 0
//}
@see String#oct, String#to_i, String#to_f,
Kernel.#Integer, Kernel.#Float
このメソッドの逆に数値を文字列に変換するには
Kernel.#sprintf, String#%,
Integer#to_s
などを使ってください。... -
String
# oct -> Integer (8007.0) -
文字列を 8 進文字列であると解釈して、整数に変換します。
...{
p "-010".oct # => -8
p "-0x10".oct # => -16
p "-0b10".oct # => -2
p "1_0_1x".oct # => 65
//}
@see String#hex, String#to_i, String#to_f,
Kernel.#Integer, Kernel.#Float
逆に、数値を文字列に変換するにはKernel.#sprintf,
String#%, Integer#to_s を使用します。... -
String
# to _ f -> Float (8007.0) -
文字列を 10 進数表現と解釈して、浮動小数点数 Float に変換します。
...# => Infinity
# warning: Float 10101010101010101010... out of range
//}
なお、このメソッドとは逆に、数値を文字列に変換するには
Kernel.#sprintf, String#%, Integer#to_s
を使用します。
@see String#hex, String#oct, String#to_i,
Kernel.#Integer, Kernel.#Float... -
String
# to _ i(base = 10) -> Integer (8007.0) -
文字列を 10 進数表現された整数であると解釈して、整数に変換します。
...する整数。0 か、2〜36 の整数。
@return 整数
このメソッドの逆に数値を文字列に変換するには、
Kernel.#sprintf, String#%, Integer#to_s
を使用します。
String#hex, String#oct, String#to_f,
Kernel.#Integer, Kernel.#Float
も参照してください。... -
Symbol
# =~(other) -> Integer | nil (8007.0) -
正規表現 other とのマッチを行います。
...正規表現 other とのマッチを行います。
(self.to_s =~ other と同じです。)
@param other 比較対象のシンボルを指定します。
@return マッチが成功すればマッチした位置のインデックスを、そうでなければ nil を返します。
p :foo =~... -
Symbol
# capitalize -> Symbol (8007.0) -
シンボルに対応する文字列の先頭の文字を大文字に、残りを小文字に変更した シンボルを返します。
...シンボルに対応する文字列の先頭の文字を大文字に、残りを小文字に変更した
シンボルを返します。
(self.to_s.capitalize.intern と同じです。)
:foobar.capitalize #=> :Foobar
:fooBar.capitalize #=> :Foobar
:FOOBAR.capitalize #=> :Foobar... -
Symbol
# capitalize(*options) -> Symbol (8007.0) -
シンボルに対応する文字列の先頭の文字を大文字に、残りを小文字に変更した シンボルを返します。
...シンボルに対応する文字列の先頭の文字を大文字に、残りを小文字に変更した
シンボルを返します。
(self.to_s.capitalize.intern と同じです。)
:foobar.capitalize #=> :Foobar
:fooBar.capitalize #=> :Foobar
:FOOBAR.capitalize #=> :Foobar... -
Symbol
# downcase -> Symbol (8007.0) -
大文字を小文字に変換したシンボルを返します。
...大文字を小文字に変換したシンボルを返します。
(self.to_s.downcase.intern と同じです。)
:FOO.downcase #=> :foo
@see String#downcase... -
Symbol
# downcase(*options) -> Symbol (8007.0) -
大文字を小文字に変換したシンボルを返します。
...大文字を小文字に変換したシンボルを返します。
(self.to_s.downcase.intern と同じです。)
:FOO.downcase #=> :foo
@see String#downcase... -
Symbol
# end _ with?(*suffixes) -> bool (8007.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
# length -> Integer (8007.0) -
シンボルに対応する文字列の長さを返します。
...シンボルに対応する文字列の長さを返します。
(self.to_s.length と同じです。)
:foo.length #=> 3
@see String#length, String#size...