# Count

\<evalcmd> Count && int && 路径分量的数目。 && 路径 && 路径 && 任意路径。\</evalcmd>

返回路径中组件的数目。

//<Example://>

```
p: path = "C:\Windows\System32";
Output( Count(p) );
--> 3
```

*另请参阅：*\
[isparent](/directory-opus/guan-fang-shou-ce/readme.zh-10/readme.zh-4/isparent.zh.md)\
[parent](/directory-opus/guan-fang-shou-ce/readme.zh-10/readme.zh-4/parent.zh.md)

***

\<evalcmd> Count && int && 子字符串匹配的数目。 && 字符串 && str && 搜索的字符串。 && 子字符串 && str && 要搜索的子字符串。 && \[标志] && str && 标志。\</evalcmd>

返回找到 *substring* 在 *string* 中的次数。

可选标志 **c** 使搜索区分大小写。

//<Example://>

```
str = "Hello world";
Output( Count(str, "l") );
--> 3
```

*另请参阅：*\
[instr](/directory-opus/guan-fang-shou-ce/readme.zh-10/readme.zh-4/instr.zh.md)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://chaoses-ib.gitbook.io/directory-opus/guan-fang-shou-ce/readme.zh-10/readme.zh-4/count.zh.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
