[Haskell-cafe] isSpace
Brent Yorgey
byorgey at gmail.com
Tue Dec 4 13:33:55 EST 2007
On Dec 4, 2007 1:29 PM, Ryan Bloor <ryanbloor at hotmail.com> wrote:
> HI
>
> I will try and explain it better.
> I am meaning to write a function that takes a string, " apple" and
> eliminates the spaces at the start ONLY. called........ removeSpace ::
> String -> String
>
> I decided to use the function 'dropWhile' and another one 'isSpace' in the
> 'removeSpace' function.
>
> removeSpace:: String -> String
> removeSpace a = case dropWhile isSpace a of
> "" ->
>
I am not sure why you think you need to do a case analysis here. Think
about what 'dropWhile isSpace' does.
-Brent
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20071204/34cd56ff/attachment.htm
More information about the Haskell-Cafe
mailing list