Summary of Java methods for obtaining file extensions [regular and string interception]
•
Java
This paper describes the method of obtaining file extension in Java. Share with you for your reference, as follows:
Problem Description: there is a string type: string imagename = "ZY. JPG"; How can I intercept "." The following dropout
Solution 1: use regular expressions
Solution 2:
JavaScript regular expression online test tool: http://tools.jb51.net/regex/javascript
Regular expression online generation tool: http://tools.jb51.net/regex/create_reg
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
二维码