Harbor freight sander with vacuum

R count occurrences of string in vector

Task. Create a function, or show a built-in function, to count the number of non-overlapping occurrences of a substring inside a string. The function should take two arguments: the first argument being the string to search, and. the second a substring to be searched for. It should return an integer count.