Ruby Newbie homepage Ruby Newbie homepage

How to use

Quick guide

Official content
Returns a string containing the first character of self:
s = 'foo' # => "foo"
s.chr     # => "f"
 
               static VALUE
rb_str_chr(VALUE str)
{
    return rb_str_substr(str, 0, 1);
}
            

Was this page useful?