Count occurrences of a substring: Difference between revisions
Content deleted Content added
/* {{header|Go}} |
|||
Line 316:
>>> "ababababab".count("abab")
2</lang>
=={{header|Snobol4}}==
<lang snobol4>
DEFINE("countSubstring(t,s)")
OUTPUT = countSubstring("the three truths","th")
OUTPUT = countSubstring("ababababab","abab")
:(END)
countSubstring t ARB s = :F(RETURN)
countSubstring = countSubstring + 1 :(countSubstring)
END
3
2
</lang>
=={{header|Tcl}}==
|