A simple question that I don’t know if Java has also a simple solution.
I have a string like: name.ext.ext.out.end
I need to get rid of .out, always the penultimate extension. Is there a kind of indexof(), but beginning from the end? I know how to do this in a rudimentary way, but maybe there are much better ones.
There is
lastIndexOf(..)which should do.