且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在 Haskell 中拆分字符串?

更新时间:2023-02-21 12:43:18

有一个名为 拆分.

cabal install split

像这样使用它:

ghci> import Data.List.Split
ghci> splitOn "," "my,comma,separated,list"
["my","comma","separated","list"]

它带有许多其他功能,用于分割匹配的分隔符或具有多个分隔符.

It comes with a lot of other functions for splitting on matching delimiters or having several delimiters.