Scrapbook-0.4.0: code examples
Copyright© Frank Jung 2020
LicenseGPL-3
Safe HaskellSafe-Inferred
LanguageHaskell2010

Trim

Description

An inefficient alternative to dropWhile.

Examples

>>> trim " hello world "
"hello world"
>>> dropWhile' isSpace " hello world "
"hello word "
>>> dropWhileEnd' isSpace " hello world "
" hello word"
Synopsis

Documentation

dropWhile' :: (a -> Bool) -> [a] -> [a] Source #

Drop from beginning of list while predicate is true.

dropWhileEnd' :: (a -> Bool) -> [a] -> [a] Source #

Drop from end of list while predicate is true.

trimStart :: String -> String Source #

Trim white space from start of string.

trimEnd :: String -> String Source #

Trim white space from end of string.

trim :: String -> String Source #

Trim white space from start and end of string.