I have a dynamically formed string like - part1.abc.part2.abc.part3.abc
In this string I want to know position of second to last \".\" so that i can split string as
LastIndexOf should do what you want. Just do it twice.