From: Charlie Date: 2006-06-11T13:33:48+09:00 Subject: Substrings by Position. Hi, Just a logic question about substrings by position. foo = "012345678" foo[5,1] #-> "5" foo[-4,2] #-> "56" foo[-3,2] = "" #-> "0123458" Shouldn't a negative indexing work as well? (Below are just examples, they currently don't work) It will allow strings to be REVERSED easily, and thus doing something new. foo = "012345678" foo[-4,-2] #-> "43" foo[-3,-2] = "" #-> "0123678" foo[-4,-3] = "9" #-> "93678" foo[1,-2] = "123" #-> "3213678" foo = "01295678" foo[-4,-1] = "43" #-> "012345678" In other words, foo = "012345678" foo[4,1] #-> 4 foo[4,-1] #-> 3 Is this making sense? Charlie -- Posted via http://www.ruby-forum.com/.