Commit c787fea5 authored by Camil Staps's avatar Camil Staps 🐧

Fix replaceSubString for [Char]

parent ec8c0432
Pipeline #9577 passed with stage
in 1 minute and 48 seconds
......@@ -214,9 +214,7 @@ where
subString start length cs = take length (drop start cs)
replaceSubString :: ![Char] ![Char] ![Char] -> [Char]
replaceSubString repl by cs = case indexOf repl cs of
-1 -> cs
i -> concat [take i cs, by, drop (i + length repl) cs]
replaceSubString repl by cs = join by (split repl cs)
trim :: ![Char] -> [Char]
trim cs = ltrim (rtrim cs)
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