From: Brian H. <bh...@sp...> - 2005-10-25 15:04:14
|
On Tue, 25 Oct 2005, Brian Brunswick wrote: > I'll continue inflicting my opinion on the list:-) Ditto :-) > > I would say no, it shouldn't wrap again. I think its useful behaviour > to have endpoints that silently truncate, and not useful to have ones > that wrap around. Wrapping also brings up the possibility of the substring operation returning a string that is *longer* than the original string. Consider the case where I ask for the substring going from index -2 to (String.length s) - 1 inclusive. How long of a string should this return? One possible returns a string of length 2 (containing characters -2 and -1 inclusive), and another says it should return a string of length (String.length s) + 2, with characters -2 and -1 duplicated twice, once at the begining of the string and once at the end. Now, what happens when I ask for the string going from -(String.length s) - 2 to 2*(String.length s)? And so on. Brian |