Method: Kernel#String

Defined in:
object.c

#String(arg) ⇒ String

Converts arg to a String by calling its to_s method.

String(self)        #=> "main"
String(self.class   #=> "Object"
String(123456)      #=> "123456"

Returns:



# File 'object.c'

/*
 *  call-seq:
 *     String(arg)   => string
 *  
 *  Converts <i>arg</i> to a <code>String</code> by calling its
 *  <code>to_s</code> method.
 *     
 *     String(self)        #=> "main"
 *     String(self.class   #=> "Object"
 *     String(123456)      #=> "123456"
 */

static VALUE
rb_f_string(obj, arg)
    VALUE obj, arg;
{
    return rb_String(arg);
}