| Copyright | (c) The University of Glasgow 2007 |
|---|---|
| License | BSD-style (see the file libraries/base/LICENSE) |
| Maintainer | libraries@haskell.org |
| Stability | experimental |
| Portability | portable |
| Safe Haskell | Trustworthy |
| Language | Haskell2010 |
Data.String
Contents
Description
TheString type and associated operations.
Class for string-like datastructures; used by the overloaded string extension (-XOverloadedStrings in GHC).
Methods
fromString ::String -> aSource#
lines ::String -> [String]Source#
lines breaks a string up into a list of strings at newline characters. The resulting strings do not contain newlines.
Note that after splitting the string at newline characters, the last part of the string is considered a line even if it doesn't end with a newline. For example,
>>>lines ""[]
>>>lines "\n"[""]
>>>lines "one"["one"]
>>>lines "one\n"["one"]
>>>lines "one\n\n"["one",""]
>>>lines "one\ntwo"["one","two"]
>>>lines "one\ntwo\n"["one","two"]
Thus contains at least as many elements as newlines inlines ss.
words ::String -> [String]Source#
words breaks a string up into a list of words, which were delimited by white space.
>>>words "Lorem ipsum\ndolor"["Lorem","ipsum","dolor"]
Produced byHaddock version 2.20.0