s[-1]

----- Original Message ----- 
From: "Morris, Chris" <chris.morris / snelling.com>
To: "ruby-talk ML" <ruby-talk / ruby-lang.org>
Sent: Friday, October 26, 2001 3:42 PM
Subject: [ruby-talk:23500] Get last character in string?


> Is there a more concise way to do this?
> 
>   irb(main):005:0> s = "abcd"
>   "abcd"
>   irb(main):006:0> s[s.length - 1, 1]
>   "d"
> 
> Chris Morris
> chris.morris / snelling.com
> 
>