Skip to content

Instantly share code, notes, and snippets.

@antife-yinyue
Created March 17, 2016 07:00
Show Gist options
  • Save antife-yinyue/8b7d2336434df83dd4e4 to your computer and use it in GitHub Desktop.
Save antife-yinyue/8b7d2336434df83dd4e4 to your computer and use it in GitHub Desktop.
class Path {
static func basename(path: String) -> String {
return ((path as NSString).lastPathComponent as NSString).stringByDeletingPathExtension
}
static func dirname(path: String) -> String {
return (path as NSString).stringByDeletingLastPathComponent
}
static func extname(path: String) -> String {
return (path as NSString).pathExtension
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment