On 2/8/07, Unknown <borg / uu3.net> wrote:
> On Thu, 8 Feb 2007, Micah Wylde wrote:
>
> > I'm not a contributor, but I am a user of ruby, and there is a
> > possibility that no one seems to have mentioned. What about having
> > String.ord return an array of integers, with a one character string
> > returning a one element array?
> >
> > So "test".ord => [116, 101, 115, 116]
> > "a".org => [97]
> >
> I must disagree with you. This would make things even slower.
> Usualy you use String::ord to get value of one specified char.
> String::ord(index) sounds best from all propositions Ive seens here.
> Its elegant anf fast.
> Also.. if you want such behavior.. I think it would be better to provide
> range functionality to ord aswell
> "test".ord -> 116
> "test".ord(1) -> 101
> "test".ord(1..2) -> [101,115]
>
> What Do you think guys about that?

I think it's time we see some actual use cases for String#ord.

  nikolai