From: Brian Candler Date: 2007-06-01T20:15:54+09:00 Subject: Getting the last N bytes of a string: What's the simplest way to get only the last 10 bytes of a string? buf[-10,10] doesn't work if buf is smaller than 10 bytes, as it returns nil. Is there anything simpler than buf[-10,10] || buf ? Thanks, Brian. P.S. To get the *first* 10 bytes of a string is easy: buf[0,10] always works, whether or not buf is smaller than 10 bytes)