Count occurrences of a substring: Difference between revisions
Add APL
Not a robot (talk | contribs) (Add 8086 assembly) |
Not a robot (talk | contribs) (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}}==
|