+ 1

String st="PROGRAM"; System .out.println(st.indexOf(st.charAt(4)));

30th Sep 2017, 4:39 AM
Anshika Maurya
Anshika Maurya - avatar
2 Answers
+ 7
//R 1
30th Sep 2017, 4:44 AM
Gaurav Agrawal
Gaurav Agrawal - avatar
0
Answer is 1. If you want output as 4, try st.lastIndexOf()...
2nd Oct 2017, 12:53 PM
Dragon Slayer Xavier
Dragon Slayer Xavier - avatar