1、查找字符串最后一次出现的位置

String str = "my name is zzw";
int lastIndex = str.lastIndexOf("zzw");
if (lastIndex == -1) {
    System.out.println("zzw 404");
} else {
    System.out.println(lastIndex);
}
字符串查找

相关文章:

  • 2021-07-30
  • 2021-07-20
  • 2022-12-23
  • 2021-04-12
  • 2021-11-28
  • 2022-12-23
  • 2022-12-23
  • 2021-12-06
猜你喜欢
  • 2021-11-30
  • 2022-01-25
  • 2021-12-13
  • 2021-07-31
  • 2021-10-18
  • 2021-12-12
  • 2021-05-24
相关资源
相似解决方案