How to get the count of occurrences of a particular string from Datatable? - TestingQ.com

-->Exclusive Portal for Testing Jobs

How to get the count of occurrences of a particular string from Datatable?

Ans:
searchStr="Test"
intRows=dataTable.GetSheet(1).GetRowCount
intCols=DataTable.GetSheet(1).GetParameterCount
intCount=0
For i= 1 to intRows
 DataTable.SetCurrentRow i
 For j=1 to intCols
  If Trim(Datatable.Value(j,1))=searchStr  then
  intCount=intCount+1
   end if
 Next
Next
msgbox "search string found these many times" & intCount

To receive daily posted JOBS & Interview Questions
Just enter your email address below and click 'Submit'
Enter your email address:

Make sure to activate your subscription by clicking on the activation link sent to your email