В Mon, 2 Jan 2012 10:45:18 +0100
Yves Parès <[email protected]> пишет:

Prelude> lines "string1\nstring2\r\nstring3\nstring4"
["string1","string2\r","string3","string4"]

> Doesn't the function "lines" handle different line-endings?
> (In the Prelude and in Data.List)
> 
> If not, doing this with parsec would be easy (yet maybe slightly
> overkill...)
> 
> 
> 2012/1/2 max <[email protected]>
> 
> > I want to write a function whose behavior is as follows:
> >
> > foo "string1\nstring2\r\nstring3\nstring4" = ["string1",
> > "string2\r\nstring3", "string4"]
> >
> > Note the sequence "\r\n", which is ignored. How can I do this?
> >
> > _______________________________________________
> > Haskell-Cafe mailing list
> > [email protected]
> > http://www.haskell.org/mailman/listinfo/haskell-cafe
> >


_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to