On the meaning of string.length

Ary Borenszweig via Digitalmars-d-announce digitalmars-d-announce at puremagic.com
Wed Nov 19 13:00:49 PST 2014


On 11/19/14, 11:33 AM, Adam D. Ruppe wrote:
> I answered a random C# stackoverflow question about why string.length
> returns the value it does with some rationale defending code units
> instead of "characters" - basically, I typed up a defense of D's
> string-as-array behavior.

In Ruby `length` returns the number of unicode characters and `bytesize` 
returns the number of bytes. I prefer this use of the names.


More information about the Digitalmars-d-announce mailing list