From: Stephen Fickas Date: 2008-03-07T08:29:58+09:00 Subject: Re: Sequence reduction Nice. I know, rtfm, right? Steve William James wrote: > On Mar 6, 1:13 pm, James Gray, Junior > wrote: >> On Mar 6, 2008, at 1:01 PM, Stephen Fickas wrote: >> >>> I'd like to take a string like that below >>> "0011122234667889" >>> and reduce to >>> "012346789" >> How about this? >> >> >> "0011122234667889".split("").uniq.join >> => "012346789" > > Not good. > > irb(main):002:0> "0011122234667889".squeeze > => "012346789" > >> James Gray, Junior >