I have a basic string "phraseinList", I want to know how many words are there in this string, the words are seperated by ' ' or '-'

For example:
string phraseinList = "Fronto-parietal lobe";

Note: '-' only appears in some of the strings.

I want the result "3". I know I can do that by countint ' ' and '-', but is there any simple way to do that?

Thanks.