function countSubstrings(subject, substring) {
    var subjectString = coerceToString(subject);
    var substringString = coerceToString(substring);
    var substringLength = substringString.length;
    var count = 0;
    var matchIndex = 0;

    if (subjectString === '' || substringString === '') {
      return count;
    }

    do {
      matchIndex = subjectString.indexOf(substringString, matchIndex);

      if (matchIndex !== -1) {
        count++;
        matchIndex += substringLength;
      }
    } while (matchIndex !== -1);

    return count;
  }
Counts the number of `substring` appearances in `subject`.

@function countSubstrings
@static
@since 1.0.0
@memberOf Count
@param  {string} [subject=''] The string where to count.
@param  {string} substring    The substring to be counted.
@return {number}              Returns the number of `substring` appearances.
@example
v.countSubstrings('bad boys, bad boys whatcha gonna do?', 'boys');
// => 2

v.countSubstrings('every dog has its day', 'cat');
// => 0