代碼
提交代碼
public class StringMethod2 {
public static void main(String[] args) {
String str = "I love Java, I love imooc!";
int i = str.lastIndexOf('e');
System.out.println("字符e在字符串str最后一次出現(xiàn)的位置為:" + i);
}
}
運(yùn)行結(jié)果