最速Rubyリファレンスマニュアル検索!
すべて(7)
1.9.3(1)
2.0.0(1)
2.1.0(1)
2.2.0(1)
2.3.0(1)
2.4.0(1)
2.5.0(1)
7件ヒット
[1-7件を表示]
(0.085秒)
トップページ
>
:
Kernel
>
:
モジュール関数
>
:Object#to_s
別のキーワード
each io#each
each_line io#each
each io#gets
open io#seek
read io#read
ライブラリ
ビルトイン
(7)
検索結果
先頭1件
Kernel
.
#
String(arg) -> String
Kernel
.
#
String(arg) -> String
(8.0)
1.9.3
2.0.0
2.1.0
2.2.0
2.3.0
2.4.0
2.5.0
モジュール関数
引数を文字列(String)に変換した結果を返します。
...
もせず arg を返します。
@param arg 変換対象のオブジェクトです。
@raise TypeError to_s の返り値が文字列でなければ発生します。
class Foo
def to_s
"hogehoge"
end
end
arg = Foo.new
p String(arg) #=> "hogehoge"
@see
Object#to_s
,String
...
Object#to_s
String