> For the complete documentation index, see [llms.txt](https://ddzy.gitbook.io/ts-utility-plugins-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ddzy.gitbook.io/ts-utility-plugins-docs/utility/utility-string.md).

# utility-string

### 说明

汇集有关`字符串`的工具方法

### 源码

{% embed url="<https://github.com/ddzy/ts-utility-plugins/tree/master/src/ddzy/utility/string>" %}

### 目录

| Name         | Description                       | Source                                                                                            | Docs                                                                  |
| ------------ | --------------------------------- | ------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------- |
| getRandomStr | 获取`随机`的`乱序`字符串                    | [源码](https://github.com/ddzy/ts-utility-plugins/tree/master/src/ddzy/utility/string/getRandomStr) | [文档](/ts-utility-plugins-docs/utility/utility-string/getrandomstr.md) |
| trim         | 去除字符串首尾的指定字符, 默认为空格(`whitespace`) | [源码](https://github.com/ddzy/ts-utility-plugins/tree/master/src/ddzy/utility/string/trim)         | [文档](/ts-utility-plugins-docs/utility/utility-string/trim.md)         |
| capitalize   | 将指定的字符串的`首字母`大写, 剩下为小写            | [源码](https://github.com/ddzy/ts-utility-plugins/tree/master/src/ddzy/utility/string/capitalize)   | [文档](/ts-utility-plugins-docs/utility/utility-string/capitalize.md)   |
| endsWith     | 检查字符串`text`是否以给定的`target`字符串结尾    | [源码](https://github.com/ddzy/ts-utility-plugins/tree/master/src/ddzy/utility/string/endsWith)     | [文档](/ts-utility-plugins-docs/utility/utility-string/endswith.md)     |
| lowerCase    | 转换字符串`string`以空格分开单词, 并转换为`小写`    | [源码](https://github.com/ddzy/ts-utility-plugins/tree/master/src/ddzy/utility/string/lowerCase)    | [文档](/ts-utility-plugins-docs/utility/utility-string/lowercase.md)    |
| words        | 按照指定模式, 拆分字符串 `string` 中的词为数组     | [源码](https://github.com/ddzy/ts-utility-plugins/tree/master/src/ddzy/utility/string/words)        | [文档](/ts-utility-plugins-docs/utility/utility-string/words.md)        |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://ddzy.gitbook.io/ts-utility-plugins-docs/utility/utility-string.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
