Method: String#codepoints
- Defined in:
- string.c
#codepoints ⇒ Array
Returns an array of the Integer ordinals of the characters in str. This is a shorthand for str.each_codepoint.to_a
.
If a block is given, which is a deprecated form, works the same as each_codepoint
.
8845 8846 8847 8848 8849 8850 |
# File 'string.c', line 8845
static VALUE
rb_str_codepoints(VALUE str)
{
VALUE ary = WANTARRAY("codepoints", rb_str_strlen(str));
return rb_str_enumerate_codepoints(str, ary);
}
|