> ## Documentation Index
> Fetch the complete documentation index at: https://rpa.bazhuayu.com/helpcenter/llms.txt
> Use this file to discover all available pages before exploring further.

# 去除空格

## 指令说明

**描述：** 去除文本内容中的空格

## 参数说明

<Tabs>
  <Tab title="常规">
    <img src="https://mintcdn.com/bazhuayu-rpa-docs/QLw4prvAN-mejJU5/helpcenter/commands/data-processing/images/trimtextcommand-02.png?fit=max&auto=format&n=QLw4prvAN-mejJU5&q=85&s=7b2c76a9169fa369640243ede5c8b960" alt="去除空格指令参数面板" width="978" height="615" data-path="helpcenter/commands/data-processing/images/trimtextcommand-02.png" />

    | 参数         | 说明                    |
    | ---------- | --------------------- |
    | **原始文本：**  | 输入文本字符串或者选择一个包含字符串的变量 |
    | **选择操作：**  | 去除两头空格/去除开头空格/去除结尾空格  |
    | **保存结果至：** | 保存内容至变量               |
  </Tab>

  <Tab title="高级">
    本指令暂无高级参数。
  </Tab>
</Tabs>

## 使用示例

<img src="https://mintcdn.com/bazhuayu-rpa-docs/QLw4prvAN-mejJU5/helpcenter/commands/data-processing/images/trimtextcommand-03.png?fit=max&auto=format&n=QLw4prvAN-mejJU5&q=85&s=753391689419081c1e265b63f3c32841" alt="去除空格使用示例" width="1536" height="345" data-path="helpcenter/commands/data-processing/images/trimtextcommand-03.png" />

**该流程执行逻辑：**

使用【设置变量】设置带空格的字符串变量： 八爪鱼

使用【打印日志】字符串的文本长度：13

使用【去除空格】指令为字符串变量去除两头的空格，将结果保存至变量

使用【打印日志】指令打印去除空格后的变量的文本长度：3

### 效果展示

<img src="https://mintcdn.com/bazhuayu-rpa-docs/QLw4prvAN-mejJU5/helpcenter/commands/data-processing/images/trimtextcommand-01.png?fit=max&auto=format&n=QLw4prvAN-mejJU5&q=85&s=003f711bbde544c97a42b3f350774dc0" alt="去除空格效果展示" width="1540" height="442" data-path="helpcenter/commands/data-processing/images/trimtextcommand-01.png" />

<Info>
  使用指令过程中遇到问题？前往 [八爪鱼RPA 开发者社区问答板块](https://rpa.bazhuayu.com/community/questions) 提问，获取官方与社区帮助。
</Info>
