Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
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
You can’t perform that action at this time.