functioncountstr (str1, str2)
DIMTMP, I, J.
ifstr1 = "" orisnull (str1) lalu
j = 0
elseifstr2 = "" orisnull (str2) lalu
j = 1
kalau tidak
tmp = split (str1, str2)
j = 0
fori = 0toubound (tmp)
iftmp (i) <> "" thenj = j+1
Berikutnya
endif
countstr = j
fungsi endfungsi