Jump to content

Count occurrences of a substring: Difference between revisions

RPL: add section
(Add Draco)
(RPL: add section)
Line 2,927:
6
</pre>
 
=={{header|RPL}}==
{{works with|Halcyon Calc|4.2.7}}
≪ DUP2 → s t
≪ SIZE SWAP SIZE
'''IF''' DUP2 * LAST ≤ AND '''THEN'''
SWAP - 1 + 0 R→C
'''WHILE''' DUP RE 0 > '''REPEAT'''
s OVER RE DUP t SIZE + 1 - SUB
'''IF''' t == '''THEN''' t SIZE -1 R→C - '''ELSE''' (1,0) - '''END'''
'''END'''
IM
'''ELSE''' DROP2 -1 '''END'''
≫ ≫ ''''CNTSUB'''' STO
 
=={{header|Ruby}}==
1,150

edits

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