Created
April 6, 2019 10:41
-
-
Save dimohamdy/198fea5c6a4955ec21e1f19c8aae2486 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
extension String { | |
func fileName() -> String { | |
return URL(fileURLWithPath: self).deletingPathExtension().lastPathComponent | |
} | |
func fileExtension() -> String { | |
return URL(fileURLWithPath: self).pathExtension | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment