Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- subs :: String -> String -> String -> String
- -- example:
- -- subs 'x' "x^3 + x + sin(x)" "6.2" will generate
- -- "6.2^3 + 6.2 + sin(6.2)"
- import Text.Regex(mkRegex, subRegex)
- subs :: String -> String -> String -> String
- subs wildcard input value = subRegex (mkRegex wildcard) input value
- import Text.Format
- format "{0}^3 + {0} + sin({0})" ["6.2"]
Add Comment
Please, Sign In to add comment