Count occurrences of a substring: Difference between revisions
Count occurrences of a substring (view source)
Revision as of 15:27, 16 September 2015
, 8 years ago→{{header|Erlang}}
Line 520:
-module(substrings).
-export([main/2]).
%% String and Sub exhausted, count a match and present result
match([], [], _OrigSub, Acc) ->
Acc+1;
%% String exhausted, present result
|