Location.nameExcludingExtension removes dots from filenames#124
Location.nameExcludingExtension removes dots from filenames#124maximkrouk wants to merge 1 commit intoJohnSundell:masterfrom
Conversation
|
The dot is part of the extension. Why would you want the dot at the end??? |
|
alternatively, use |
|
@jflow, didn't see your comment at the time 😅 Not in the end, but in the middle |
|
@honghaoz, not sure that casting to extension String {
var nameExcludingExtension: String {
guard
let index = lastIndex(of: "."),
index != startIndex
else { return self }
return String(self[startIndex..<index])
}
}
And also this implementation will handle hidden files correctly like |
No description provided.