English

Give the output of the following String class method: "COMMENCEMENT".lastIndex0f('M')

Advertisements
Advertisements

Question

Give the output of the following String class method:

"COMMENCEMENT".lastIndexOf('M')
Answer in Brief
Advertisements

Solution

8

Explanation:

The lastIndexOf('M') returns the index of the last occurrence of 'M' in the string.

shaalaa.com
  Is there an error in this question or solution?
Chapter 10: String Handling - Exercises [Page 249]

APPEARS IN

Rupa Pandit Computer Applications [English] Class 10 ICSE
Chapter 10 String Handling
Exercises | Q 6. (a) | Page 249
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×