VOOZH about

URL: https://apidock.com/ruby/String/chars

⇱ String#chars - APIdock


method

chars

ruby latest stable - Class: String
chars()
public

Returns an array of characters in str. This is a shorthand for str.each_char.to_a.

If a block is given, which is a deprecated form, works the same as each_char.

static VALUE
rb_str_chars(VALUE str)
{
 VALUE ary = WANTARRAY("chars", rb_str_strlen(str));
 return rb_str_enumerate_chars(str, ary);
}

Related methods