From: Jeff Putsch Date: 2001-10-27T04:48:06+09:00 Subject: [ruby-talk:23501] Re: Get last character in string? On Sat, Oct 27, 2001 at 04:42:38AM +0900, Morris, Chris wrote: > 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" How about: irb(main):003:0> s = "abcd" "abcd" irb(main):004:0> s[-1].chr "d" Jeff. -- Jeff Putsch Email: putsch@mxim.com Maxim Integrated Products Office: (503)547-2037 High Frequency CAD Engineering