The lastIndexOf() method is utilized to return the index of the last appearance of the character we specify in the argument from the stated string.
Method Definition: int lastIndexOf(int ch)
Return Type: It returns the index of the last appearance of the character in the argument.
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.