| 123456789101112131415161718 |
- const getFileName = (url: string): string => {
- if (url) {
- const index = url.lastIndexOf('/')
- return url.substring(index + 1)
- } else {
- return ''
- }
- }
- const getFileType = (url: string): string => {
- if (url) {
- const index = url.lastIndexOf('.')
- return url.substring(index + 1)
- } else {
- return ''
- }
- }
- export {getFileName,getFileType}
|