> ## Documentation Index
> Fetch the complete documentation index at: https://dripart-docs-recommend-assets-api.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# StringTrim - ComfyUI Built-in Node Documentation

> Complete documentation for the StringTrim node in ComfyUI. Learn its inputs, outputs, parameters and usage.

> 本文档由 AI 生成。如果您发现任何错误或有改进建议，欢迎贡献！ [在 GitHub 上编辑](https://github.com/Comfy-Org/embedded-docs/blob/main/comfyui_embedded_docs/docs/StringTrim/zh.md)

StringTrim 节点用于移除文本字符串开头、结尾或两侧的空白字符。您可以选择从字符串的左侧、右侧或两侧进行修剪。这对于通过移除不需要的空格、制表符或换行符来清理文本输入非常有用。

## 输入参数

| 参数名      | 数据类型   | 必填 | 取值范围                            | 描述                                                                  |
| -------- | ------ | -- | ------------------------------- | ------------------------------------------------------------------- |
| `string` | STRING | 是  | -                               | 要处理的文本字符串。支持多行输入。                                                   |
| `mode`   | COMBO  | 是  | "Both"<br />"Left"<br />"Right" | 指定要修剪字符串的哪一侧。"Both" 移除两端的空白字符，"Left" 仅移除开头的空白字符，"Right" 仅移除末尾的空白字符。 |

## 输出结果

| 输出名称     | 数据类型   | 描述                     |
| -------- | ------ | ---------------------- |
| `output` | STRING | 根据所选模式移除空白字符后的修剪文本字符串。 |
