| Copyright | Dennis Gosnell 2017 |
|---|---|
| License | BSD3 |
| Maintainer | Dennis Gosnell (cdep.illabout@gmail.com) |
| Stability | experimental |
| Portability | unknown |
| Safe Haskell | Safe |
| Language | Haskell2010 |
Servant.Static.TH.Internal.Util
Description
Utilities functions for use in this package.
Synopsis
- removeLeadingPeriod :: String -> String
- getExtension :: FilePath -> FilePath
Documentation
removeLeadingPeriod :: String -> String Source #
Remove a leading period from a String.
>>>removeLeadingPeriod ".jpg""jpg"
Just return the String if it doesn't start with a period:
>>>removeLeadingPeriod "hello""hello"
Return an empty string if the only character in the string is a period:
>>>removeLeadingPeriod "."""
Remove at most one period:
>>>removeLeadingPeriod "..bye"".bye"
getExtension :: FilePath -> FilePath Source #
Return an extension for a FilePath. Just like takeExtension, but
doesn't return the leading period.
>>>getExtension "/some/file.html""html"
Empty string is returned for files with no extension:
>>>getExtension "file"""