Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →
instance method
String#bytesize
() -> ::Integer
bytesize → integer
string.c
View on GitHub ↗
VALUE
rb_str_bytesize(VALUE str)
{
return LEN2NUM(RSTRING_LEN(str));
}