Method: U::String#length

Defined in:
ext/u/rb_u_string_length.c

#lengthInteger Also known as: size

Returns The number of characters in the receiver.

Returns:

  • (Integer)

    The number of characters in the receiver



4
5
6
7
8
9
10
# File 'ext/u/rb_u_string_length.c', line 4

VALUE
rb_u_string_length(VALUE self)
{
        const struct rb_u_string *string = RVAL2USTRING(self);

        return UINT2NUM(u_n_chars_n(USTRING_STR(string), USTRING_LENGTH(string)));
}