java获得文件扩展名:

public static void main(String[] args) throws Exception {
    String name = "";
    String extention = "";
    if(fileName.length()>0 && fileName!=null){  //--截取文件名
        int i = fileName.lastIndexOf(".");
        if(i>-1 && i<fileName.length()){
        name = fileName.substring(0, i); //--文件名
        extention = fileName.substring(i+1); //--扩展名
        }
    }
}

相关文章:

  • 2022-12-23
  • 2022-03-08
  • 2022-12-23
  • 2021-11-30
  • 2021-06-25
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-01-04
  • 2021-09-25
  • 2021-08-15
  • 2021-12-08
  • 2021-07-01
  • 2021-10-19
相关资源
相似解决方案