Mega Code Archive

 
Categories / Ruby / String
 

Starting at the end of the string using negative numbers, get the second to last character through the eighth to last

thoreau = "asdfasdfasdfadsfasdfasdfadsf" puts thoreau[-8..-2]