截取文件扩展名

比如

"//winkong-pic.oss-cn-qingdao.aliyuncs.com/pic/test/winkong/2021/12/09/hello%281%29.pdf"
 String substring = fileUrl.substring(fileUrl.lastIndexOf("."));

结果是.pdf

 String substring = fileUrl.substring(fileUrl.lastIndexOf(".")).substring(1);

去掉.

猜你喜欢

转载自blog.csdn.net/xiyangyang8110/article/details/125224947