Skip to content
Snippets Groups Projects
Commit c7e7786d authored by Ian Lynagh's avatar Ian Lynagh
Browse files

Use the standard stripPrefix

parent 397231c7
No related branches found
No related tags found
No related merge requests found
......@@ -7,6 +7,7 @@
module Main where
import Data.Char
import Data.List
import System.IO.Error
main :: IO ()
......@@ -174,9 +175,9 @@ trimr :: String -> String
trimr s = reverse (dropWhile isSpace (reverse s))
skip :: String -> String -> String
skip val s = if val `isPrefixOf` (trim s) then
drop (length val) (trim s)
else s
skip val s = case stripPrefix val (trim s) of
Just s' -> s'
Nothing -> s
htmlEncode :: Char -> String
htmlEncode '>' = ">"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment