Contains useful generic functions not found elsewhere.
- class ToString a where
- removeBreak :: String -> String
- lowerFirst :: String -> String
- upperFirst :: String -> String
- spaceToBlank :: String -> String
- trimWs :: String -> String
Documentation
removeBreak :: String -> StringSource
Remove all line breaks in a string
"testtest" == removeBreak "test\n\rtest\r"
lowerFirst :: String -> StringSource
Convert first character in String to lower.
lowerFirst "Foo" == "foo" lowerFirst "BaR" == "baR" lowerFirst "g0O" == "g0O".'
upperFirst :: String -> StringSource
Convert first character in String to upper.
upperFirst "foo" == "Foo" upperFirst "bAr" == "BAr" upperFirst "G0O" == "G0O".'
spaceToBlank :: String -> StringSource
Convert every space (' ') in a string to a blank ('_') instead.
spaceToBlank " " == "_" spaceToBlank " foo " == "_foo__" spaceToBlank "b a r" == "b_a_r"