From: Jos Backus Date: 2005-02-10T16:07:37+09:00 Subject: Re: How to mimic Perl's `s///' in Ruby? On Thu, Feb 10, 2005 at 09:05:05AM +0900, Florian Gross wrote: > Jos Backus wrote: > Not sure why you'd want to do that (.slice!() works better IMHO), but > perhaps you can do it like this: > > "hello"[/((?:hallo)?)/, 1] = "" Yes, that works too. And I just tried the slice! version and it is more elegant than the [] solution. Thanks Florian. -- Jos Backus _/ _/_/_/ Sunnyvale, CA _/ _/ _/ _/ _/_/_/ _/ _/ _/ _/ jos at catnook.com _/_/ _/_/_/ require 'std/disclaimer'