代码
提交代码
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最后一次出现的位置为:" + i); } }
运行结果