perl-like strip
This commit is contained in:
parent
c0b1d8694b
commit
0c4cf88578
@ -42,6 +42,9 @@ import Text.ParserCombinators.Parsec
|
||||
|
||||
-- strings
|
||||
|
||||
strip = dropspaces . reverse . dropspaces . reverse
|
||||
where dropspaces = dropWhile (`elem` " \t")
|
||||
|
||||
elideLeft width s =
|
||||
case length s > width of
|
||||
True -> ".." ++ (reverse $ take (width - 2) $ reverse s)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user