countString function

int countString(
  1. String sub,
  2. String original
)

Count number of occurrences in a String.

Implementation

int countString(String sub, String original) {
  return elemIndicesString(sub, original).length;
}