public Method

Kernel.String(p1)

String(arg)    string

Converts arg to a String by calling its to_s method.

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

Source Code

/*
*  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);
}
Comments

Have your say
Please use Textile formatting (click here for a cheat sheet). Use <code/> and <pre/> for code samples.
Click here to login with OpenID to to post comments.