functionCountstr (str1, str2)
Dimtmp, я, J.
ifStr1 = "" Orisnull (str1) затем
j = 0
elseifstr2 = "" orisnull (str2) тогда
J = 1
еще
tmp = split (str1, str2)
j = 0
fori = 0toubound (tmp)
iftmp (i) <> "" thenj = j+1
следующий
эндиф
counttr = j
конечная функция