Count occurrences of a substring: Difference between revisions

Add APL
(Add 8086 assembly)
(Add APL)
Line 308:
Count String : 5
</pre>
 
=={{header|APL}}==
{{works with|Dyalog APL}}
 
<lang apl>csubs←{0=x←⊃⍸⍺⍷⍵:0 ⋄ 1+⍺∇(¯1+x+⍴⍺)↓⍵}</lang>
 
{{out}}
 
<pre> 'th' 'abab' 'dog' csubs¨ 'the three truths' 'ababababab' 'cat'
3 2 0</pre>
 
=={{header|AppleScript}}==
2,125

edits