From: Wilson Bilkovich Date: 2006-02-12T09:16:58+09:00 Subject: Re: Getting last character from a string On 2/11/06, 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] > You can do: last_char = x[-1,1] or # possibly too arcane last_char = x.split('').last The second has the advantage of being (I think) multibyte-character safe.