Minor performance improvement. Use String.lastIndexOf(int)/indexOf(int) instead of String.lastIndexOf(String)/indexOf(String).