FunctionCountStr (str1, str2)
dimtmp, i, j
ifstr1 = "" orisnull (str1) แล้ว
J = 0
elseifstr2 = "" orisnull (str2) แล้ว
J = 1
อื่น
tmp = split (str1, str2)
J = 0
fori = 0toubound (tmp)
iftmp (i) <> "" จากนั้น j = j+1
ต่อไป
endif
countstr = j
endfunction