count method

int count(
  1. Pattern pattern
)

Implementation

int count(Pattern pattern) => split(pattern).length - 1;