Java String.lastIndexOf() Online
Find last index of a substring.
Run details
The output updates as you type. The tool processes input in your browser.
Worked example
A repeated substring can have different first and last positions. Browser offsets start at zero.
- Needle
"manuals"
manuals plus manuals
13
Using this operation in Java
The interactive result uses JavaScript. String indexes count UTF-16 code units. Use codePoints() when iterating supplementary Unicode characters and Locale.ROOT for locale-independent casing.