Automating QTP Test Automation Home Automation Articles Downloads QTP Gotchas Links Books Contact About Site Map
String Function - CountThis function counts the number of occurences of a search-string in a target-string. Download it Here (right-click and then save target as). (NOTE - you can just cut & paste from below, but the formatting will have multiple spaces instead of tabs).
'=========================================================================
Function zStr_Count(sInput, sSrch) Dim iCount, sTemp iCount = 0 sTemp = sInput While inStr(sTemp,sSrch) > 0 iCount = iCount + 1 sTemp = Replace(sTemp, sSrch, "", 1, 1) Wend zStr_Count = iCount End Function '========================================================================= |