1 File file = new File("config.ini");
2 String suffix = file.getName().substring(file.getName().lastIndexOf(".") + 1);
3 if(suffix.equals("ini")) {
4 //true
5 } else {
6 //false
7 }
1 File file = new File("config.ini");
2 String suffix = file.getName().substring(file.getName().lastIndexOf(".") + 1);
3 if(suffix.equals("ini")) {
4 //true
5 } else {
6 //false
7 }
本篇文章将介绍几种常见的方法来判断Java代码中异步操作是否完成。
首先利用fileReader.readAsText(filePart) 默认通过utf8格式读取文件,如果文件中有非utf8字符会替换成�, 如果有�说明有非utf8字符。
举报文章
请选择举报类型
补充说明
0/200
上传截图
格式支持JPEG/PNG/JPG,图片不超过1.9M