#On Apr 15, 2005, at 7:50 PM, Peña, Botp wrote:
···
James Edward Gray II [mailto:james@grayproductions.net] wrote:
#
#> #> btw, is there a Char class?
#> #
#> #No, there's not. See Integer#chr.
#>
#> i was looking for the other way around, like Chr#integer.
#
#We've just been playing with examples of that:
#
#String#[char_index]
yes; but it still is other way around; so one has to take one more step.
irb(main):016:0> x="string"[0]
=> 115
irb(main):021:0> x.chr
=> "s"
# or
irb(main):022:0> x="string"[0].chr
=> "s"
i was hoping to get
irb(main):016:0> x="string"[0]
=> "s"
thinking that a string is a sequence of chars. i do not want to think char
as int (or long :); it feels like asm/hardcoreC prgg...
it is really a nuby thingy question. may not be important really...
thanks and kind regards -botp
#
#James Edward Gray II
#
#