Closed GoogleCodeExporter closed 9 years ago
I know other languages have done the "negative indices count from the end of
the string" thing, but I dunno if that's something I'd like to see in Java. =/
Original comment by wasserman.louis
on 29 Aug 2012 at 12:45
Other languages offer negative indices support (and slicing, like Python) for
collections/sequences in general. As strings are usually treated as a list of
characters, that's just a specialization.
As `String` in Java implements `CharSequence` but not `Collection` or
`Iterable`, this unfortunately isn't doable by, say, adding methods to
`Iterables` and applying them to strings. :(
Then again, selecting (and not just checking against, like `String.endsWith`)
trailing characters from a string is quite handy every now and then.
Original comment by j...@nwsnet.de
on 29 Aug 2012 at 9:35
Original comment by kak@google.com
on 23 Oct 2012 at 4:51
This issue has been migrated to GitHub.
It can be found at https://github.com/google/guava/issues/<id>
Original comment by cgdecker@google.com
on 1 Nov 2014 at 4:13
Original comment by cgdecker@google.com
on 1 Nov 2014 at 4:18
Original comment by cgdecker@google.com
on 3 Nov 2014 at 9:08
Original issue reported on code.google.com by
ddlat...@gmail.com
on 28 Aug 2012 at 11:39