From: Chris Morris Date: 2012-05-01T02:46:47+09:00 Subject: Re: delete character from array --e89a8f22c66399adef04bee9096a Content-Type: text/plain; charset=ISO-8859-1 On Mon, Apr 30, 2012 at 12:11 PM, Brian Candler wrote: > Chris Morris wrote in post #1058975: > > This is a little blunt, but may be what you need: > > > > '123123123123'.scan(/(\w\w)\w/).to_s > > => "12121212" > > That doesn't delete every third character in the string though, as a > couple of simple tests will show: > Good point. -- Chris http://livingsocial.com | http://clabs.org --e89a8f22c66399adef04bee9096a Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
On Mon, Apr 30, 2012 at 12:11 PM, Brian Candler = <lists@ruby-forum.com> wrote:
Chris Morris wrote in post #1058975:
> This is a little blunt, but may be what you need: >
> '123123123123'.scan(/(\w\w)\w/).to_s
> =3D> "12121212"

That doesn't delete every third character in the string though, a= s a
couple of simple tests will show:

Good = point.

--
Chris
http://livingsocial.com=A0|=A0http://clabs.org

--e89a8f22c66399adef04bee9096a--