Commit c7e7786d authored by Ian Lynagh's avatar Ian Lynagh
Browse files

Use the standard stripPrefix

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