From: djberg96@... (Daniel Berger) Date: 2004-10-26T00:24:09+09:00 Subject: Re: [rcr] String#first / String#last "Robert Klemme" wrote in message news:<2u3rh2F22mbfkU1@uni-berlin.de>... > "trans. (T. Onoma)" schrieb im Newsbeitrag > news:200410250001.59113.transami@runbox.com... > > On Sunday 24 October 2004 11:54 pm, Yukihiro Matsumoto wrote: > > | Hi, > > | > > | In message "Re: [rcr] String#first / String#last" > > | > > | on Mon, 25 Oct 2004 09:18:51 +0900, Hal Fulton > writes: > > | |I think I'd be opposed to that. But adding a to_a might be good -- I > > | |frequently do a gratuitous split operation for that purpose. > > | > > | It already has "to_a" which works line-wise. Perhaps something called > > | "explode" in other language is what you want. > > > > Believe their is an RCR for #chars > > > > def chars > > split(//) > > end > > This does not yield characters but strings with length 1. Note also that > there is String#each_byte which is often sufficient. > > Kind regards > > robert I prefer String#unpack("C*"). I'm not sure what encoding issues there are with that, however. Dan