Count occurrences of a substring: Difference between revisions

Content added Content deleted
Line 520: Line 520:
-module(substrings).
-module(substrings).
-export([main/2]).
-export([main/2]).

%% String and Sub exhausted, count a match and present result
match([], [], _OrigSub, Acc) ->
Acc+1;


%% String exhausted, present result
%% String exhausted, present result