I am looking for a predefined function to get the path from the path, including the file name. So instead of getting the file name, I want another part.
Of course, I can do this as my own:
func PathOnly() -> String { let n = NSURL(fileURLWithPath: self).lastPathComponent?.characters.count return self.Left(self.characters.count - n!) }
when to extend String, but why reinvent the wheel? :-) Any idea?
source share