Anonymous user
Count occurrences of a substring: Difference between revisions
Count occurrences of a substring (view source)
Revision as of 09:29, 28 September 2015
, 8 years agoAdded EchoLisp
(Added EchoLisp) |
|||
Line 444:
<pre>3
2</pre>
=={{header|EchoLisp}}==
<lang scheme>
;; from Racket
(define count-substring
(compose length regexp-match*))
(count-substring "aab" "graabaabdfaabgh") ;; substring
→ 3
(count-substring "/ .e/" "Longtemps je me suis couché de bonne heure") ;; regexp
→ 4
</lang>
=={{header|Eiffel}}==
|