So I read this answer and this answer on the differences between subSequence()
and subString()
and I understand that the only difference between the two is the return type. In fact, subSequence()
calls subString()
under the hood.
In addition, this article on subSequence states at the end that:
There is no benefit in using
subSequence
method, ideally you should always use Stringsubstring
method.
Is there really no benefit to using subSequence()
? If so, why has it been introduced? If there is a benefit, what is it and what known uses are for it?