---
title: "split"

doc_type: static
doc_category: static
doc_version: v20260901
source_url:
  html: 'https://developer.shopline.com/zh-hans-cn/docs/handlebars/helpers/string/split'
  md: 'https://developer.shopline.com/zh-hans-cn/docs/handlebars/helpers/string/split.md'
---


# split

使用指定的分隔符将字符串拆分为数组中的单独元素。

## 参数

- `str1` `{String}` 输入字符串，必需
- `separator` `{String}` 分隔符，必需
- `return` `{Array}` 返回字符串数组

## 用法

```handlebars
{{ split str1 separator }}
```

## 例子

<Example>
```handlebars
{{ split "a,b,c" "," }}
```
</Example>
