functionCountSTR (STR1, STR2)
dimtmp, i, j
ifstr1 = "" orisnull (str1) então
j = 0
elseifstr2 = "" orisnull (str2) então
j = 1
outro
tmp = split (str1, str2)
j = 0
fori = 0Toubound (TMP)
iftmp (i) <> "" thenj = j+1
próximo
endif
CountStr = j
Função final