From: "F. Senault" Date: 2007-07-20T19:09:59+09:00 Subject: Re: Is there a replacement for sub? Le 20 juillet � 11:12, Pe�a, Botp a �crit : > a.sub! will modify a. so, do NOT use a=a.sub!, it's NOT right. > just use plain a.sub!. ruby has already simplified it, do not make > it simpler :) And, while you're at it, depending on the situation, sub! returning nil may be quite useful : a = "a b c d e f" for i in 1..1_000 break unless a.sub!(' ', '') end (I.e. breaking if there is nothing else to substitute, instead of looping 995 times for nothing.) Fred -- Close the shop, let's take a drive Take a break from 9 to 5 It's so great to be alive, oh yeah We could rent some roller skates We could skate around the lake If we don't know how, we'll fake it, oh yeah (Prince, Strollin')