haskell get specific elements of a String

The solution for “haskell get specific elements of a String” can be found here. The following code will assist you in solving the problem.

onlyParenthesis :: String -> String
onlyParenthesis [] = []
onlyParenthesis (x:xs)
| x /= ‘(‘ && x /= ‘)’ && x /= ‘[‘ && x /= ‘]’ && x /= ‘{‘ && x /= ‘}’= onlyParenthesis xs
| otherwise = x : onlyParenthesis xs

Thank you for using DeclareCode; We hope you were able to resolve the issue.

More questions on [categories-list]

0
inline scripts encapsulated in