| 发表于:2007-04-13 17:17:5421楼 得分:0 |
private function instrcount(byval source as string, byval find as string) as long if len(source) > 0 then instrcount = ubound(split(source, find)) end if end function public function instrcount( _ sourcestring as string, _ findstring as string, _ optional byval start as long = 1, _ optional comparetype as vbcomparemethod = vbbinarycompare) as long ' dim l as long ' l = len(findstring) ' if l > 0 then ' if start < 1 then start = 1 end if ' do start = instr(start, sourcestring, findstring, comparetype) if start then instrcount = instrcount + 1 start = start + l else exit function end if loop end if ' end function | | |
|