From: Hal Fulton Date: 2004-10-26T02:15:03+09:00 Subject: Re: [rcr] String#first / String#last Robert Klemme wrote: > "trans. (T. Onoma)" schrieb im Newsbeitrag >>On Sunday 24 October 2004 11:54 pm, Yukihiro Matsumoto wrote: >>| 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. In my mind, I blur the distinction between chars and "length 1" strings. I am fully aware of the difference, but I rarely have need of characters as Fixnums. Ruby in the future (as I understand it) will also blur this distinction further: Apparently ?x will be the same as "x" and "abc"[1] will be "b". Hal