Hi all, I need help to extract data from a data table and print book titles that contain the word “science” but I can only have a maximum of 10 matching entries that contain the word “science”.
so far I have:
for each row in data table
if row.item(0).ToString.Contains(“science”)
then print value.
I’m not sure how to stop printing after 10 matches of the book title containing the word “science” I would really appreciate the help!!
Using the For Each Row, we can assign a Integer variable as the index and Use it in If Condition to Check if is Equal to the Count needed and then exit the loop using Break.