[#1551] Hashes as keys — "Nathaniel Talbott" <nathaniel@...>

I was just playing around with Hash#hash and discovered that you can't use a

13 messages 2003/09/23

String#downcase! bug/oddness (?)

From: Ryan Pavlik <rpav@...>
Date: 2003-09-02 23:18:26 UTC
List: ruby-core #1501
This may or may not be considered a bug, but I don't see it documented
anywhere, and it's somewhat odd IMO:

    "A".downcase! => "a"
    "a".downcase! => nil

Now, returns for bang-functions might not seem useful, but consider when
you have something like:

    get_a_big_string.downcase!

You can presumably gain efficiency by operating on the existing string,
instead of copying it.  This applies to most of the string functions,
IMHO, but it's just my opinion after all.

-- 
Ryan Pavlik <rpav@mephle.com>

"Let me tell you, I find your math to be highly suspect." - 8BT

In This Thread

Prev Next