We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
count
1 parent 018455d commit dab00b7Copy full SHA for dab00b7
2 files changed
src/Data/String.purs
@@ -23,6 +23,7 @@ module Data.String
23
, dropWhile
24
, stripPrefix
25
, stripSuffix
26
+ , count
27
, split
28
, toCharArray
29
, toLower
test/Test/Data/String.purs
@@ -142,6 +142,12 @@ testString = do
142
assert $ drop 3 "ab" == ""
143
assert $ drop (-1) "ab" == "ab"
144
145
+ log "count"
146
+ assert $ count (_ == 'a') "" == 0
147
+ assert $ count (_ == 'a') "ab" == 1
148
+ assert $ count (_ == 'a') "aaab" == 3
149
+ assert $ count (_ == 'a') "abaa" == 1
150
+
151
log "split"
152
assert $ split "" "" == []
153
assert $ split "" "a" == ["a"]
@@ -167,4 +173,3 @@ testString = do
167
173
assert $ joinWith "" [] == ""
168
174
assert $ joinWith "" ["a", "b"] == "ab"
169
175
assert $ joinWith "--" ["a", "b", "c"] == "a--b--c"
170
-
0 commit comments