Method: Kernel#String
- Defined in:
- object.c
#String(arg) ⇒ String
Returns arg as a String.
First tries to call its to_str
method, then its to_s
method.
String(self) #=> "main"
String(self.class) #=> "Object"
String(123456) #=> "123456"
3929 3930 3931 3932 3933 |
# File 'object.c', line 3929
static VALUE
rb_f_string(VALUE obj, VALUE arg)
{
return rb_String(arg);
}
|