Method: String#to_s

Defined in:
string.c

#to_sself, String

Returns self if self is a String, or self converted to a String if self is a subclass of String.

Returns:



7061
7062
7063
7064
7065
7066
7067
7068
# File 'string.c', line 7061

static VALUE
rb_str_to_s(VALUE str)
{
    if (rb_obj_class(str) != rb_cString) {
        return str_duplicate(rb_cString, str);
    }
    return str;
}