Ruby Newbie homepage Ruby Newbie homepage

How to use

Quick guide

Official content
Returns self if self is a String, or self converted to a String if self is a subclass of String.
String#to_str is an alias for String#to_s.
               static VALUE
rb_str_to_s(VALUE str)
    if (rb_obj_class(str) != rb_cString) {
        return str_duplicate(rb_cString, str);
    return str;

Was this page useful?