# 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: 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://ddzy.gitbook.io/ts-utility-plugins-docs/utility/utility-string.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.
