Anonymous user
Tokenize a string: Difference between revisions
→{{header|Haskell}}
(→{{header|Haskell}}: another example) |
|||
Line 324:
Tokenizing can also be realized by using unfoldr and break:
<lang Haskell>*Main> mapM_ putStrLn $
Hello
How
Line 331:
Today</lang>
* You need to import the modules Data.List and Control.Arrow
As special cases, splitting / joining by white space and by newlines are provided by the Prelude functions <tt>words</tt> / <tt>unwords</tt> and <tt>lines</tt> / <tt>unlines</tt>, respectively.
=={{header|Groovy}}==
|