Skip to content

count

strings · scripts/strings/count.m

COUNT  Count occurrences of a pattern in strings (MATLAB compat).

  N = COUNT (STR, PAT) returns the number of non-overlapping occurrences
  of PAT in STR.  STR may be a char row vector, a cellstr, or a string
  array; PAT may be a char vector or a cellstr/string of alternatives.

  N = COUNT (..., 'IgnoreCase', true) matches case-insensitively.