How to split a string in Haskell?

后端 未结 13 1579
日久生厌
日久生厌 2020-11-28 03:08

Is there a standard way to split a string in Haskell?

lines and words work great from splitting on a space or newline, but surely there is

13条回答
  •  孤城傲影
    2020-11-28 03:57

    In the module Text.Regex (part of the Haskell Platform), there is a function:

    splitRegex :: Regex -> String -> [String]
    

    which splits a string based on a regular expression. The API can be found at Hackage.

提交回复
热议问题