Ruby Newbie homepage Ruby Newbie homepage

How to use

Quick guide

Official content
Returns the count of characters (not bytes) in self:
"\x80\u3042".length # => 2
"hello".length # => 5
String#size is an alias for String#length.
Related: String#bytesize.
 
               VALUE
rb_str_length(VALUE str)
{
    return LONG2NUM(str_strlen(str, NULL));
}
            

Was this page useful?