From: Timothy Hunter Date: 2006-02-12T09:18:24+09:00 Subject: Re: Getting last character from a string draco draco wrote: > Hello > I'm new to Ruby. I've a simple question. > Is there a more readable way to get last character from string than this > one? : > > x = "text" > last_char = x[x.length-1, x.length-1] > last_char = x[-1,1] A negative index counts from the right-hand end of the string.