RosettaCodeData/Task/Binary_strings/Haskell/binary_strings-7.hs
Ingy döt Net 80737d5a6a new tasks
2013-04-09 00:46:50 -07:00

5 lines
265 B
Haskell

{- Much thanks to brool.com for this nice
and elegant solution. Using an imported standard library
(Text.Regex), replace a given substring with another -}
strReplace :: String -> String -> String -> String
strReplace old new orig = subRegex (mkRegex old) orig new