public static void main(String[] args) {
        // TODO Auto-generated method stub
  String str="123456789.abcd";
  int i=str.lastIndexOf(".");
  System.out.println(i);
  String str1=str.substring(i);
  System.out.println(str1);
    }

}

substring()和lastIndexOf()方法的用法

 

用在文件上传时,截取图片文件的饿格式。如JPG等。在拍卖项目里

相关文章:

  • 2021-07-15
  • 2019-06-12
  • 2021-09-14
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-09-29
  • 2022-03-06
  • 2022-12-23
  • 2021-09-10
相关资源
相似解决方案