Is there a simple way to count occurences of one text string within another text string?

Viewed 8003

Is there a simple way, using PowerQuery, to count the occurences of a text string within another text string?

For instance, if I have the string, "The quick brown fox jumps over the lazy dog and the lazy dog doesn't notice," how would I easily determine that the words lazy and dog occur twice?

I know I can use Text.Contains to determine whether lazy and dog occur within the string, but I don't know a simple way to determine how many times they occur.

1 Answers
Related