Project

General

Profile

Actions

Feature #9650

closed

String#size versus String#length

Added by Anonymous about 10 years ago. Updated almost 9 years ago.

Status:
Rejected
Assignee:
-
Target version:
-
[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 ?

Updated by marcandre (Marc-Andre Lafortune) about 10 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?

Updated by Anonymous over 9 years ago

-1, #size is good enough.

Updated by nobu (Nobuyoshi Nakada) over 9 years ago

  • Status changed from Open to Feedback

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

Updated by matz (Yukihiro Matsumoto) almost 9 years ago

  • Status changed from Feedback to Rejected

Rejected. It's too confusing.

Matz.

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0