Feature #9650

String#size versus String#length

Added by S├ębastien Durand 12 months ago. Updated 7 months ago.

[ruby-core:61555]
Status:Feedback
Priority:Low
Assignee:-

Description

Hi guys !

A quick idea for the next major version :

String#size => bytes length
String#length => chars length

Could this be a good move or too much BC break ?

History

#1 Updated by Marc-Andre Lafortune 12 months ago

It would probably cause a lot of breakage.

More importantly, why would it be an improvement? What's wrong with using String#bytesize in the rare case where you actually want the byte length?

#2 Updated by Boris Stitnicky 7 months ago

-1, #size is good enough.

#3 Updated by Nobuyoshi Nakada 7 months ago

  • Status changed from Open to Feedback

Why size in bytes and length in chars, not vice versa?

Also available in: Atom PDF