From: Thomas Hurst Date: 2001-12-23T10:08:48+09:00 Subject: [ruby-talk:29329] Re: upper case to lower --5p8PegU4iirBW1oA Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable * Joseph McDonald (joe@vpop.net) wrote: > Dir.foreach(dir) {|filename| > newname =3D filename.tr('A-Z','a-z') > File.rename(filename, newname) if newname !=3D filename File.rename(filename, newname) unless newname =3D=3D filename Is slightly nicer imo, since it moves the negation into a nice descriptive word and removes a structure most are used to seeing at the start of statements. --=20 Thomas 'Freaky' Hurst - freaky@aagh.net - http://www.aagh.net/ - You're already carrying the sphere! --5p8PegU4iirBW1oA Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (FreeBSD) Comment: For info see http://www.gnupg.org iD8DBQE8JS6YNBBHZ542MwQRAi4CAJ4pHnglUfRerfRgVi2AlI07G7gmqgCglpfo zEDsW7x68YTHfaTNAxGDck4= =BzGn -----END PGP SIGNATURE----- --5p8PegU4iirBW1oA--