String is to Substring, as ArrayList is to?

arraylist, java, substring

Solution

This method is called `subList` and exists for both array and linked lists. Beware that the list it returns is backed by the existing list so updating the original one will update the slice.

Problem

In Java, and many other languages, one can grab a subsection of a string by saying something like `String.substring(begin, end)`. My question is, Does there exist a built-in capability to do the same with Lists in Java that returns a sublist from the original?

Original source