> For the complete documentation index, see [llms.txt](https://kettle.gitbook.io/doc/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://kettle.gitbook.io/doc/ke-hu-duan-she-ji-qi/han-shu/count.md).

# Count

统计子串在字符串中出现的次数

· **输入**：string (string)，substring (string)

· **输出**：result (int32)

· **示例**。如果【字段选择】步骤的输入数据流中的 mystring1 字段包含字符串“chocolate drops, chocolate ice cream, chocolate bars”，那么以下函数将返回 3。

`Count(mystring1,"choc")`
