We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is there no way to get file base name (filename without extension)?
The text was updated successfully, but these errors were encountered:
Something like that should do the trick?
extension Path { var fileOnlyName: String { guard pathExtension.count > 0 else { return fileName } let extLen = pathExtension.count + 1 let nameOnlyLen = fileName.count - extLen return String(fileName.prefix(nameOnlyLen)) } }
Sorry, something went wrong.
Of course I can do that. What I was hoping for was for that to already be included in FileKit.
Sure, just wanted to have a feedback before submitting a pull request 😄
Ah in that case, that seems as good as any other way of doing it.
d534ffe
No branches or pull requests
Is there no way to get file base name (filename without extension)?
The text was updated successfully, but these errors were encountered: