Project

General

Profile

Feature #9650

String#size versus String#length

Added by S├ębastien Durand over 2 years ago. Updated over 1 year ago.

Status:
Rejected
Priority:
Normal
Assignee:
-
[ruby-core:61555]

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 [ruby-core:61556] Updated by Marc-Andre Lafortune over 2 years 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 [ruby-core:64055] Updated by Anonymous over 2 years ago

-1, #size is good enough.

#3 [ruby-core:64064] Updated by Nobuyoshi Nakada over 2 years ago

  • Status changed from Open to Feedback

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

#4 [ruby-core:69541] Updated by Yukihiro Matsumoto over 1 year ago

  • Status changed from Feedback to Rejected

Rejected. It's too confusing.

Matz.

Also available in: Atom PDF