Jump to content

Count occurrences of a substring: Difference between revisions

Add Refal
(add SETL)
(Add Refal)
Line 3,217:
ababababab - 2
</pre>
 
=={{header|Refal}}==
<syntaxhighlight lang="refal">$ENTRY Go {
= <Prout <Count ('th') 'the three truths'>>
<Prout <Count ('abab') 'abababab'>>;
};
 
Count {
(e.item) e.item e.rest = <+ 1 <Count (e.item) e.rest>>;
(e.item) s.x e.rest = <Count (e.item) e.rest>;
(e.item) = 0;
};</syntaxhighlight>
{{out}}
<pre>3
2</pre>
 
=={{header|REXX}}==
2,114

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.