How can I count specific words in a string?

With get text activity I got a sentence(1 string variable), like this: “I have an apple. I would like to eat an apple. I like apple.” In this sentence I would like to count the “apple” word.

How can I count this “apple” word?


this will give you the count, (txt = string variable)
System.Text.RegularExpressions.Regex.Split(txt, "apple").Length-1



try with this

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.